2021-09-02 22:05:38 +02:00
|
|
|
---
|
2021-01-19 18:56:49 +01:00
|
|
|
name: Release
|
2021-01-19 16:59:21 +01:00
|
|
|
|
|
|
|
on:
|
2021-01-19 18:31:23 +01:00
|
|
|
workflow_dispatch:
|
2021-12-20 18:49:16 +01:00
|
|
|
inputs:
|
|
|
|
release_type:
|
|
|
|
description: 'Release Options'
|
|
|
|
required: true
|
|
|
|
default: 'Initial Release'
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- Initial Release
|
|
|
|
- Redeploy
|
2021-01-19 16:59:21 +01:00
|
|
|
|
|
|
|
jobs:
|
2021-01-22 00:02:22 +01:00
|
|
|
setup:
|
2021-06-01 23:14:02 +02:00
|
|
|
name: Setup
|
2021-09-16 19:15:05 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-22 00:02:22 +01:00
|
|
|
outputs:
|
2021-10-12 17:51:26 +02:00
|
|
|
package_version: ${{ steps.retrieve-version.outputs.package_version }}
|
2021-11-05 17:45:56 +01:00
|
|
|
branch-name: ${{ steps.branch.outputs.branch-name }}
|
2021-01-22 00:02:22 +01:00
|
|
|
steps:
|
2021-06-01 20:21:04 +02:00
|
|
|
- name: Branch check
|
|
|
|
run: |
|
2021-11-05 17:45:56 +01:00
|
|
|
if [[ "$GITHUB_REF" != "refs/heads/rc" ]] && [[ "$GITHUB_REF" != "refs/heads/hotfix" ]]; then
|
2021-06-01 20:21:04 +02:00
|
|
|
echo "==================================="
|
2021-11-05 17:45:56 +01:00
|
|
|
echo "[!] Can only release from the 'rc' or 'hotfix' branches"
|
2021-06-01 20:21:04 +02:00
|
|
|
echo "==================================="
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-01-22 00:02:22 +01:00
|
|
|
- name: Checkout repo
|
2021-12-20 18:49:16 +01:00
|
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
2021-01-22 00:02:22 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Get Package Version
|
|
|
|
id: retrieve-version
|
2021-01-22 00:02:22 +01:00
|
|
|
run: |
|
2021-10-12 17:51:26 +02:00
|
|
|
PKG_VERSION=$(jq -r .version src/package.json)
|
|
|
|
echo "::set-output name=package_version::$PKG_VERSION"
|
2021-01-22 00:02:22 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Check to make sure Desktop release version has been bumped
|
2021-01-22 00:02:22 +01:00
|
|
|
env:
|
2021-01-22 18:27:37 +01:00
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
2021-10-12 17:51:26 +02:00
|
|
|
run: |
|
|
|
|
latest_ver=$(hub release -L 1 -f '%T')
|
|
|
|
latest_ver=${latest_ver:1}
|
|
|
|
echo "Latest version: $latest_ver"
|
|
|
|
ver=${{ steps.retrieve-version.outputs.package_version }}
|
|
|
|
echo "Version: $ver"
|
2021-12-20 18:49:16 +01:00
|
|
|
if [ "$latest_ver" = "$ver" ] && \
|
|
|
|
[ "${{ github.event.inputs.release_type }}" == "Initial Release" ]; then
|
2021-10-12 17:51:26 +02:00
|
|
|
echo "Version has not been bumped!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-11-05 17:45:56 +01:00
|
|
|
- name: Get branch name
|
|
|
|
id: branch
|
|
|
|
run: |
|
|
|
|
BRANCH_NAME=$(basename ${{ github.ref }})
|
|
|
|
echo "::set-output name=branch-name::$BRANCH_NAME"
|
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Download all artifacts
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
|
|
|
with:
|
|
|
|
workflow: build.yml
|
|
|
|
workflow_conclusion: success
|
2021-11-05 17:45:56 +01:00
|
|
|
branch: ${{ steps.branch.outputs.branch-name }}
|
2021-10-12 17:51:26 +02:00
|
|
|
|
2021-12-21 22:25:29 +01:00
|
|
|
- name: Rename .pkg to .pkg.archive
|
2022-02-10 18:51:50 +01:00
|
|
|
env:
|
|
|
|
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
2021-12-21 22:25:29 +01:00
|
|
|
run: mv Bitwarden-${{ env.PKG_VERSION }}-universal.pkg Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive
|
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Create release
|
2021-12-20 18:49:16 +01:00
|
|
|
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
|
2021-10-12 17:51:26 +02:00
|
|
|
env:
|
|
|
|
PKG_VERSION: ${{ steps.retrieve-version.outputs.package_version }}
|
2021-01-22 00:02:22 +01:00
|
|
|
with:
|
2021-10-12 17:51:26 +02:00
|
|
|
artifacts: "Bitwarden-${{ env.PKG_VERSION }}-amd64.deb,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x86_64.rpm,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x64.freebsd,
|
|
|
|
bitwarden_${{ env.PKG_VERSION }}_amd64.snap,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x86_64.AppImage,
|
|
|
|
latest-linux.yml,
|
|
|
|
Bitwarden-Portable-${{ env.PKG_VERSION }}.exe,
|
|
|
|
Bitwarden-Installer-${{ env.PKG_VERSION }}.exe,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-ia32-store.appx,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-ia32.appx,
|
2021-10-27 22:10:15 +02:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-ia32.nsis.7z,
|
2021-10-12 17:51:26 +02:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x64-store.appx,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x64.appx,
|
2021-10-27 22:10:15 +02:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-x64.nsis.7z,
|
2021-10-12 17:51:26 +02:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-arm64-store.appx,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-arm64.appx,
|
2021-10-27 22:10:15 +02:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-arm64.nsis.7z,
|
2021-10-12 17:51:26 +02:00
|
|
|
bitwarden.${{ env.PKG_VERSION }}.nupkg,
|
|
|
|
latest.yml,
|
2021-11-02 16:24:33 +01:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-universal.dmg,
|
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap,
|
2021-10-12 17:51:26 +02:00
|
|
|
latest-mac.yml,
|
2021-12-21 22:25:29 +01:00
|
|
|
Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive"
|
2021-10-12 17:51:26 +02:00
|
|
|
commit: ${{ github.sha }}
|
|
|
|
tag: v${{ env.PKG_VERSION }}
|
|
|
|
name: Version ${{ env.PKG_VERSION }}
|
|
|
|
body: "<insert release notes here>"
|
|
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
2021-01-22 00:02:22 +01:00
|
|
|
draft: true
|
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
snap:
|
|
|
|
name: Deploy Snap
|
2021-09-16 19:15:05 +02:00
|
|
|
runs-on: ubuntu-20.04
|
2021-01-22 00:02:22 +01:00
|
|
|
needs: setup
|
2021-10-12 17:51:26 +02:00
|
|
|
env:
|
|
|
|
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
2021-01-19 16:59:21 +01:00
|
|
|
steps:
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Checkout Repo
|
2021-12-20 18:49:16 +01:00
|
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
2021-01-19 16:59:21 +01:00
|
|
|
|
2022-02-10 19:57:32 +01:00
|
|
|
- name: Login to Azure
|
|
|
|
uses: Azure/login@77f1b2e3fb80c0e8645114159d17008b8a2e475a
|
|
|
|
with:
|
|
|
|
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
|
|
|
|
|
|
|
|
- name: Retrieve secrets
|
|
|
|
id: retrieve-secrets
|
|
|
|
uses: Azure/get-keyvault-secrets@80ccd3fafe5662407cc2e55f202ee34bfff8c403
|
|
|
|
with:
|
|
|
|
keyvault: "bitwarden-prod-kv"
|
|
|
|
secrets: "snapcraft-store-token"
|
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Install Snap
|
2021-12-20 18:49:16 +01:00
|
|
|
uses: samuelmeuli/action-snapcraft@10d7d0a84d9d86098b19f872257df314b0bd8e2d # v1.2.0
|
2021-06-07 18:00:13 +02:00
|
|
|
with:
|
2022-02-10 19:57:32 +01:00
|
|
|
snapcraft_token: ${{ steps.retrieve-secrets.outputs.snapcraft-store-token }}
|
2021-06-07 18:00:13 +02:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Setup
|
|
|
|
run: mkdir dist
|
2021-06-07 18:00:13 +02:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Download Snap artifact
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
|
|
|
with:
|
|
|
|
workflow: build.yml
|
|
|
|
workflow_conclusion: success
|
2021-11-05 17:45:56 +01:00
|
|
|
branch: ${{ needs.setup.outputs.branch-name }}
|
2021-10-12 17:51:26 +02:00
|
|
|
artifacts: bitwarden_${{ env._PKG_VERSION }}_amd64.snap
|
|
|
|
path: ./dist
|
2021-05-26 22:44:48 +02:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Test
|
|
|
|
run: ls -alht dist
|
2021-01-19 16:59:21 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Deploy to Snap Store
|
2021-01-19 16:59:21 +01:00
|
|
|
run: |
|
2021-10-12 17:51:26 +02:00
|
|
|
snapcraft upload dist/bitwarden_${{ env._PKG_VERSION }}_amd64.snap --release stable
|
|
|
|
snapcraft logout
|
2021-01-19 16:59:21 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
choco:
|
|
|
|
name: Deploy Choco
|
2021-09-16 19:15:05 +02:00
|
|
|
runs-on: windows-2019
|
2021-01-22 00:06:32 +01:00
|
|
|
needs: setup
|
2021-10-12 17:51:26 +02:00
|
|
|
env:
|
|
|
|
_PKG_VERSION: ${{ needs.setup.outputs.package_version }}
|
2021-01-19 16:59:21 +01:00
|
|
|
steps:
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Checkout Repo
|
2021-12-20 18:49:16 +01:00
|
|
|
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f # v2.3.4
|
2021-06-07 18:00:13 +02:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Setup Chocolatey
|
|
|
|
run: choco apikey --key $env:CHOCO_API_KEY --source https://push.chocolatey.org/
|
2021-01-25 01:08:44 +01:00
|
|
|
env:
|
|
|
|
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
|
2021-01-22 00:23:03 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Make dist dir
|
2021-01-19 16:59:21 +01:00
|
|
|
shell: pwsh
|
2021-10-12 17:51:26 +02:00
|
|
|
run: New-Item -ItemType directory -Path ./dist
|
2021-01-19 16:59:21 +01:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Download choco artifact
|
|
|
|
uses: bitwarden/gh-actions/download-artifacts@23433be15ed6fd046ce12b6889c5184a8d9c8783
|
2021-06-07 18:00:13 +02:00
|
|
|
with:
|
2021-10-12 17:51:26 +02:00
|
|
|
workflow: build.yml
|
|
|
|
workflow_conclusion: success
|
2021-11-05 17:45:56 +01:00
|
|
|
branch: ${{ needs.setup.outputs.branch-name }}
|
2021-10-12 17:51:26 +02:00
|
|
|
artifacts: bitwarden.${{ env._PKG_VERSION }}.nupkg
|
|
|
|
path: ./dist
|
2021-05-26 22:44:48 +02:00
|
|
|
|
2021-10-12 17:51:26 +02:00
|
|
|
- name: Push to Chocolatey
|
2021-01-25 00:23:41 +01:00
|
|
|
shell: pwsh
|
|
|
|
run: |
|
2021-10-12 17:51:26 +02:00
|
|
|
cd dist
|
|
|
|
choco push
|