Devops 829 Add electron beta channels (#2838)

* Add option for beta channels in package.json for electron

* Change placement of build settings

* Add version

* Revert "Add version"

This reverts commit 2e09cc7d5e.

* Add electron version to package.json

* Move build to higher level

* Add upload beta autoupdate

* Revert version

* Updating the release workflow with the new channels

* restrict GitHub Release to only 'latest'

* fixing electron-builder configuration

* version bump test

* fixing words

* Commenting out the npm cache in the windows build job

* Adding back in the caching for the future

* Revert "version bump test"

This reverts commit b732d00841.

Co-authored-by: Joseph Flinn <joseph.s.flinn@gmail.com>
This commit is contained in:
Michał Chęciński 2022-06-07 15:44:25 +02:00 committed by GitHub
parent a22c6c55ed
commit bd6cdf3aa3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 10 deletions

View File

@ -64,6 +64,7 @@ jobs:
runs-on: ubuntu-20.04
outputs:
package_version: ${{ steps.retrieve-version.outputs.package_version }}
release_channel: ${{ steps.release-channel.outputs.channel }}
build_number: ${{ steps.increment-version.outputs.build_number }}
rc_branch_exists: ${{ steps.branch-check.outputs.rc_branch_exists }}
hotfix_branch_exists: ${{ steps.branch-check.outputs.hotfix_branch_exists }}
@ -87,6 +88,23 @@ jobs:
echo "Setting build number to $BUILD_NUMBER"
echo "::set-output name=build_number::$BUILD_NUMBER"
- name: Get Version Channel
id: release-channel
run: |
case "${{ steps.retrieve-version.outputs.package_version }}" in
*"alpha"*)
echo "::set-output name=channel::alpha"
echo "[!] We do not yet support 'alpha'"
exit 1
;;
*"beta"*)
echo "::set-output name=channel::beta"
;;
*)
echo "::set-output name=channel::latest"
;;
esac
- name: Check if special branches exist
id: branch-check
run: |
@ -188,11 +206,11 @@ jobs:
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-x86_64.AppImage
if-no-files-found: error
- name: Upload latest auto-update artifact
- name: Upload auto-update artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: latest-linux.yml
path: apps/desktop/dist/latest-linux.yml
name: ${{ needs.setup.outputs.release_channel }}-linux.yml
path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-linux.yml
if-no-files-found: error
@ -373,11 +391,11 @@ jobs:
path: apps/desktop/dist/chocolatey/bitwarden.${{ env._PACKAGE_VERSION }}.nupkg
if-no-files-found: error
- name: Upload latest auto-update artifact
- name: Upload auto-update artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: latest.yml
path: apps/desktop/dist/nsis-web/latest.yml
name: ${{ needs.setup.outputs.release_channel }}.yml
path: apps/desktop/dist/nsis-web/${{ needs.setup.outputs.release_channel }}.yml
if-no-files-found: error
@ -704,11 +722,11 @@ jobs:
path: apps/desktop/dist/Bitwarden-${{ env._PACKAGE_VERSION }}-universal.dmg.blockmap
if-no-files-found: error
- name: Upload latest auto-update artifact
- name: Upload auto-update artifact
uses: actions/upload-artifact@6673cd052c4cd6fcf4b4e6e60ea986c889389535
with:
name: latest-mac.yml
path: apps/desktop/dist/latest-mac.yml
name: ${{ needs.setup.outputs.release_channel }}-mac.yml
path: apps/desktop/dist/${{ needs.setup.outputs.release_channel }}-mac.yml
if-no-files-found: error

View File

@ -23,6 +23,7 @@ jobs:
runs-on: ubuntu-20.04
outputs:
release-version: ${{ steps.version.outputs.version }}
release-channel: ${{ steps.release-channel.outputs.channel }}
branch-name: ${{ steps.branch.outputs.branch-name }}
steps:
- name: Branch check
@ -48,6 +49,23 @@ jobs:
monorepo: true
monorepo-project: desktop
- name: Get Version Channel
id: release-channel
run: |
case "${{ steps.version.outputs.version }}" in
*"alpha"*)
echo "::set-output name=channel::alpha"
echo "[!] We do not yet support 'alpha'"
exit 1
;;
*"beta"*)
echo "::set-output name=channel::beta"
;;
*)
echo "::set-output name=channel::latest"
;;
esac
- name: Get branch name
id: branch
run: |
@ -95,8 +113,10 @@ jobs:
- name: Create release
uses: ncipollo/release-action@95215a3cb6e6a1908b3c44e00b4fdb15548b1e09 # v2.8.5
if: ${{ steps.release-channel.outputs.channel }} == "latest"
env:
PKG_VERSION: ${{ steps.version.outputs.version }}
RELEASE_CHANNEL: ${{ steps.release-channel.outputs.channel }}
with:
artifacts: "apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-amd64.deb,
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-x86_64.rpm,
@ -118,7 +138,10 @@ jobs:
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal-mac.zip,
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.dmg,
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.dmg.blockmap,
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive"
apps/desktop/artifacts/Bitwarden-${{ env.PKG_VERSION }}-universal.pkg.archive,
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}.yml,
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}-linux.yml,
apps/desktop/artifacts/${{ env.RELEASE_CHANNEL }}-mac.yml"
commit: ${{ github.sha }}
tag: desktop-v${{ env.PKG_VERSION }}
name: Desktop v${{ env.PKG_VERSION }}
@ -126,6 +149,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
snap:
name: Deploy Snap
runs-on: ubuntu-20.04

View File

@ -9,6 +9,7 @@
"asarUnpack": ["**/*.node"],
"files": ["**/*", "!**/node_modules/@bitwarden/desktop-native/**/*"],
"electronVersion": "16.2.7",
"generateUpdatesFilesForAllChannels": true,
"publish": {
"provider": "generic",
"url": "https://artifacts.bitwarden.com/desktop"