diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 764bbd81b..539fb32ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,10 +13,10 @@ on: jobs: cloc: name: CLOC - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up CLOC run: | @@ -29,23 +29,23 @@ jobs: setup: name: Setup - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 outputs: package_version: ${{ steps.retrieve-version.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Get Package Version id: retrieve-version run: | PKG_VERSION=$(jq -r .version src/package.json) - echo "::set-output name=package_version::$PKG_VERSION" + echo "package_version=$PKG_VERSION" >> $GITHUB_OUTPUT linux-cli: name: Build Linux CLI - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -53,10 +53,10 @@ jobs: _PKG_FETCH_VERSION: 3.4 steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -94,10 +94,12 @@ jobs: run: npm run dist:cli:lin - name: Zip - run: zip -j ./dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip ./dist-cli/linux/bwdc ./keytar/linux/build/Release/keytar.node + run: zip -j dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip dist-cli/linux/bwdc keytar/linux/build/Release/keytar.node - name: Create checksums - run: sha256sum ./dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip | cut -d " " -f 1 > ./dist-cli/bwdc-linux-sha256-$_PACKAGE_VERSION.txt + run: | + sha256sum dist-cli/bwdc-linux-$_PACKAGE_VERSION.zip | \ + cut -d " " -f 1 > dist-cli/bwdc-linux-sha256-$_PACKAGE_VERSION.txt - name: Version Test run: | @@ -138,7 +140,7 @@ jobs: macos-cli: name: Build Mac CLI - runs-on: macos-11 + runs-on: macos-12 needs: setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -146,10 +148,10 @@ jobs: _PKG_FETCH_VERSION: 3.4 steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -187,10 +189,12 @@ jobs: run: npm run dist:cli:mac - name: Zip - run: zip -j ./dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip ./dist-cli/macos/bwdc ./keytar/macos/build/Release/keytar.node + run: zip -j dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip dist-cli/macos/bwdc keytar/macos/build/Release/keytar.node - name: Create checksums - run: sha256sum ./dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip | cut -d " " -f 1 > ./dist-cli/bwdc-macos-sha256-$_PACKAGE_VERSION.txt + run: | + sha256sum dist-cli/bwdc-macos-$_PACKAGE_VERSION.zip | \ + cut -d " " -f 1 > dist-cli/bwdc-macos-sha256-$_PACKAGE_VERSION.txt - name: Version Test run: | @@ -223,7 +227,7 @@ jobs: windows-cli: name: Build Windows CLI - runs-on: windows-2019 + runs-on: windows-2022 needs: setup env: _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} @@ -231,7 +235,7 @@ jobs: _WIN_PKG_VERSION: 3.4 steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Setup Windows builder run: | @@ -239,7 +243,7 @@ jobs: choco install reshack --no-progress - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -333,15 +337,17 @@ jobs: - name: Zip shell: cmd - run: 7z a ./dist-cli/bwdc-windows-%_PACKAGE_VERSION%.zip ./dist-cli/windows/bwdc.exe ./keytar/windows/keytar.node + run: | + 7z a .\dist-cli\bwdc-windows-%_PACKAGE_VERSION%.zip .\dist-cli\windows\bwdc.exe .\keytar\windows\keytar.node - name: Version Test + shell: pwsh run: | - Expand-Archive -Path "./dist-cli/bwdc-windows-${env:_PACKAGE_VERSION}.zip" -DestinationPath "./test/windows" - $testVersion = Invoke-Expression '& ./test/windows/bwdc.exe -v' - echo "version: $env:_PACKAGE_VERSION" + Expand-Archive -Path "dist-cli\bwdc-windows-${{ env._PACKAGE_VERSION }}.zip" -DestinationPath "test\windows" + $testVersion = Invoke-Expression '& .\test\windows\bwdc.exe -v' + echo "version: ${env:_PACKAGE_VERSION}" echo "testVersion: $testVersion" - if($testVersion -ne $env:_PACKAGE_VERSION) { + if ($testVersion -ne ${env:_PACKAGE_VERSION}) { Throw "Version test failed." } @@ -367,16 +373,17 @@ jobs: windows-gui: name: Build Windows GUI - runs-on: windows-2019 + runs-on: windows-2022 needs: setup env: + NODE_OPTIONS: --max_old_space_size=4096 _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -387,24 +394,17 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) - - name: Set Node options - run: echo "NODE_OPTIONS=--max_old_space_size=4096" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - shell: pwsh - - name: Print environment run: | node --version npm --version - name: Install AST - uses: bitwarden/gh-actions/install-ast@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/install-ast@master - name: Install Node dependencies run: npm install - # - name: Run linter - # run: npm run lint - - name: Build & Sign run: npm run dist:win env: @@ -446,16 +446,17 @@ jobs: linux-gui: name: Build Linux GUI - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: setup env: + NODE_OPTIONS: --max_old_space_size=4096 _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -466,9 +467,6 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) - - name: Set Node options - run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV - - name: Set up environment run: | sudo apt-get update @@ -501,16 +499,17 @@ jobs: macos-gui: name: Build MacOS GUI - runs-on: macos-11 + runs-on: macos-12 needs: setup env: + NODE_OPTIONS: --max_old_space_size=4096 _PACKAGE_VERSION: ${{ needs.setup.outputs.package_version }} steps: - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Set up Node - uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 + uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 with: cache: 'npm' cache-dependency-path: '**/package-lock.json' @@ -521,9 +520,6 @@ jobs: npm install -g node-gyp node-gyp install $(node -v) - - name: Set Node options - run: echo "NODE_OPTIONS=--max_old_space_size=4096" >> $GITHUB_ENV - - name: Print environment run: | node --version @@ -619,7 +615,7 @@ jobs: check-failures: name: Check for failures - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 needs: - cloc - setup @@ -668,7 +664,7 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/get-keyvault-secrets@master if: failure() with: keyvault: "bitwarden-ci" diff --git a/.github/workflows/enforce-labels.yml b/.github/workflows/enforce-labels.yml index 8ddef0836..53829101e 100644 --- a/.github/workflows/enforce-labels.yml +++ b/.github/workflows/enforce-labels.yml @@ -7,7 +7,7 @@ on: jobs: enforce-label: name: EnforceLabel - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Enforce Label uses: yogevbd/enforce-label-action@a3c219da6b8fa73f6ba62b68ff09c469b3a1c024 # 2.2.2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 627c241ca..2cba3d2c4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ on: jobs: setup: name: Setup - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Branch check if: ${{ github.event.inputs.release_type != 'Dry Run' }} @@ -30,13 +30,13 @@ jobs: fi - name: Checkout repo - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 - name: Retrieve Directory Connector release version id: retrieve-version run: | PKG_VERSION=$(jq -r .version src/package.json) - echo "::set-output name=package_version::$PKG_VERSION" + echo "package_version=$PKG_VERSION" >> $GITHUB_OUTPUT - name: Check to make sure Mobile release version has been bumped if: ${{ github.event.inputs.release_type == 'Initial Release' }} @@ -58,7 +58,7 @@ jobs: id: branch run: | BRANCH_NAME=$(basename ${{ github.ref }}) - echo "::set-output name=branch-name::$BRANCH_NAME" + echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT - name: Create GitHub deployment uses: chrnorm/deployment-action@d42cde7132fcec920de534fffc3be83794335c00 # v2.0.5 @@ -69,10 +69,10 @@ jobs: environment: 'production' description: 'Deployment ${{ steps.retrieve-version.outputs.package_version }} from branch ${{ steps.branch.outputs.branch-name }}' task: release - + - name: Download all artifacts if: ${{ github.event.inputs.release_type != 'Dry Run' }} - uses: bitwarden/gh-actions/download-artifacts@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/download-artifacts@master with: workflow: build.yml workflow_conclusion: success @@ -80,7 +80,7 @@ jobs: - name: Download all artifacts if: ${{ github.event.inputs.release_type == 'Dry Run' }} - uses: bitwarden/gh-actions/download-artifacts@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/download-artifacts@master with: workflow: build.yml workflow_conclusion: success @@ -114,7 +114,7 @@ jobs: body: "" token: ${{ secrets.GITHUB_TOKEN }} draft: true - + - name: Update deployment status to Success if: ${{ success() }} uses: chrnorm/deployment-status@2afb7d27101260f4a764219439564d954d10b5b0 # v2.0.1 diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 83b800831..94cfbf842 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -11,11 +11,11 @@ on: jobs: bump_version: name: "Create version_bump_${{ github.event.inputs.version_number }} branch" - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 steps: - name: Checkout Branch - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 - + uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 + - name: Login to Azure - Prod Subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 with: @@ -23,7 +23,7 @@ jobs: - name: Retrieve secrets id: retrieve-secrets - uses: bitwarden/gh-actions/get-keyvault-secrets@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/get-keyvault-secrets@master with: keyvault: "bitwarden-ci" secrets: "github-gpg-private-key, github-gpg-private-key-passphrase" @@ -34,7 +34,7 @@ jobs: gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }} passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }} git_user_signingkey: true - git_commit_gpgsign: true + git_commit_gpgsign: true - name: Create Version Branch run: | @@ -47,7 +47,7 @@ jobs: ref: version_bump_${{ github.event.inputs.version_number }} - name: Bump Version - Package - uses: bitwarden/gh-actions/version-bump@c970b0fb89bd966749280e832928db62040812bf + uses: bitwarden/gh-actions/version-bump@master with: version: ${{ github.event.inputs.version_number }} file_path: "./src/package.json" @@ -80,6 +80,6 @@ jobs: - [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc) - [ ] Build/deploy pipeline (DevOps) - [X] Other - + ## Objective Automated version bump to ${{ github.event.inputs.version_number }}"