mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
Added dry run logic for release workflow (#495)
This commit is contained in:
23
.github/workflows/release.yml
vendored
23
.github/workflows/release.yml
vendored
@@ -12,6 +12,7 @@ on:
|
|||||||
options:
|
options:
|
||||||
- Initial Release
|
- Initial Release
|
||||||
- Redeploy
|
- Redeploy
|
||||||
|
- Dry Run
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup:
|
setup:
|
||||||
@@ -22,6 +23,7 @@ jobs:
|
|||||||
branch-name: ${{ steps.branch.outputs.branch-name }}
|
branch-name: ${{ steps.branch.outputs.branch-name }}
|
||||||
steps:
|
steps:
|
||||||
- name: Branch check
|
- name: Branch check
|
||||||
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
run: |
|
run: |
|
||||||
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
||||||
echo "==================================="
|
echo "==================================="
|
||||||
@@ -31,7 +33,7 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # 2.3.4
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # 2.4.0
|
||||||
|
|
||||||
- name: Retrieve CLI release version
|
- name: Retrieve CLI release version
|
||||||
id: retrieve-version
|
id: retrieve-version
|
||||||
@@ -69,7 +71,8 @@ jobs:
|
|||||||
branch: ${{ steps.branch.outputs.branch-name }}
|
branch: ${{ steps.branch.outputs.branch-name }}
|
||||||
|
|
||||||
- name: Create release
|
- name: Create release
|
||||||
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
|
uses: ncipollo/release-action@40bb172bd05f266cf9ba4ff965cb61e9ee5f6d01 # v1.9.0
|
||||||
env:
|
env:
|
||||||
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
||||||
with:
|
with:
|
||||||
@@ -98,16 +101,16 @@ jobs:
|
|||||||
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
||||||
|
|
||||||
- name: Login to Azure
|
- name: Login to Azure
|
||||||
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf
|
||||||
with:
|
with:
|
||||||
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
||||||
|
|
||||||
- name: Retrieve secrets
|
- name: Retrieve secrets
|
||||||
id: retrieve-secrets
|
id: retrieve-secrets
|
||||||
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
uses: Azure/get-keyvault-secrets@b5c723b9ac7870c022b8c35befe620b7009b336f
|
||||||
with:
|
with:
|
||||||
keyvault: "bitwarden-prod-kv"
|
keyvault: "bitwarden-prod-kv"
|
||||||
secrets: "snapcraft-store-token"
|
secrets: "snapcraft-store-token"
|
||||||
@@ -126,6 +129,7 @@ jobs:
|
|||||||
artifacts: bw_${{ env._PKG_VERSION }}_amd64.snap
|
artifacts: bw_${{ env._PKG_VERSION }}_amd64.snap
|
||||||
|
|
||||||
- name: Publish Snap & logout
|
- name: Publish Snap & logout
|
||||||
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
run: |
|
run: |
|
||||||
snapcraft push bw_${{ env._PKG_VERSION }}_amd64.snap --release stable
|
snapcraft push bw_${{ env._PKG_VERSION }}_amd64.snap --release stable
|
||||||
snapcraft logout
|
snapcraft logout
|
||||||
@@ -139,7 +143,7 @@ jobs:
|
|||||||
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
||||||
|
|
||||||
- name: Setup Chocolatey
|
- name: Setup Chocolatey
|
||||||
run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
|
run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
|
||||||
@@ -160,6 +164,7 @@ jobs:
|
|||||||
path: ./dist
|
path: ./dist
|
||||||
|
|
||||||
- name: Push to Chocolatey
|
- name: Push to Chocolatey
|
||||||
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
shell: pwsh
|
shell: pwsh
|
||||||
run: |
|
run: |
|
||||||
cd dist
|
cd dist
|
||||||
@@ -174,7 +179,7 @@ jobs:
|
|||||||
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2.4.0
|
||||||
|
|
||||||
- name: Download artifacts
|
- name: Download artifacts
|
||||||
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
||||||
@@ -186,8 +191,7 @@ jobs:
|
|||||||
path: build
|
path: build
|
||||||
|
|
||||||
- name: Setup NPM
|
- name: Setup NPM
|
||||||
run: |
|
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
||||||
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
|
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
|
|
||||||
@@ -195,4 +199,5 @@ jobs:
|
|||||||
run: npm install -g husky
|
run: npm install -g husky
|
||||||
|
|
||||||
- name: Publish NPM
|
- name: Publish NPM
|
||||||
|
if: ${{ github.event.inputs.release_type != 'Dry Run' }}
|
||||||
run: npm publish --access public
|
run: npm publish --access public
|
||||||
|
|||||||
Reference in New Issue
Block a user