1
0
mirror of https://github.com/bitwarden/desktop.git synced 2024-11-24 11:55:50 +01:00

Update pipelines (#936)

* Update workflows for consistency

* Update pipelines

- Trigger deploy workflow manually
- Publish release draft at the end of deploy workflow

* Enable artifact uploads for all branches and fail if no asset is found during upload

* Add if statements back in for MacOS

* Change Build application (dev) step
This commit is contained in:
Vince Grassia 2021-06-01 17:14:02 -04:00 committed by GitHub
parent 60f3d5d33e
commit 163351c3e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 32 deletions

View File

@ -7,10 +7,9 @@ on:
- 'gh-pages' - 'gh-pages'
jobs: jobs:
cloc: cloc:
name: CLOC
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
@ -24,8 +23,8 @@ jobs:
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
linux: linux:
name: Linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up Node - name: Set up Node
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
@ -74,42 +73,43 @@ jobs:
run: npm run dist:lin run: npm run dist:lin
- name: Upload .deb artifact - name: Upload .deb artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-amd64.deb name: Bitwarden-${{ env.PACKAGE_VERSION }}-amd64.deb
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-amd64.deb path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-amd64.deb
if-no-files-found: error
- name: Upload .rpm artifact - name: Upload .rpm artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.rpm name: Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.rpm
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.rpm path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.rpm
if-no-files-found: error
- name: Upload .freebsd artifact - name: Upload .freebsd artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-x64.freebsd name: Bitwarden-${{ env.PACKAGE_VERSION }}-x64.freebsd
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64.freebsd path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64.freebsd
if-no-files-found: error
- name: Upload .snap artifact - name: Upload .snap artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: bitwarden_${{ env.PACKAGE_VERSION }}_amd64.snap name: bitwarden_${{ env.PACKAGE_VERSION }}_amd64.snap
path: ./dist/bitwarden_${{ env.PACKAGE_VERSION }}_amd64.snap path: ./dist/bitwarden_${{ env.PACKAGE_VERSION }}_amd64.snap
if-no-files-found: error
- name: Upload .AppImage artifact - name: Upload .AppImage artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.AppImage name: Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.AppImage
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.AppImage path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x86_64.AppImage
if-no-files-found: error
windows: windows:
name: Windows
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- name: Set up dotnet - name: Set up dotnet
@ -210,48 +210,49 @@ jobs:
choco pack ./dist/chocolatey/bitwarden.nuspec --version "$env:PACKAGE_VERSION" --out ./dist/chocolatey choco pack ./dist/chocolatey/bitwarden.nuspec --version "$env:PACKAGE_VERSION" --out ./dist/chocolatey
- name: Upload portable exe artifact - name: Upload portable exe artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe name: Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe
path: ./dist/Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe path: ./dist/Bitwarden-Portable-${{ env.PACKAGE_VERSION }}.exe
if-no-files-found: error
- name: Upload installer exe artifact - name: Upload installer exe artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe name: Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe
path: ./dist/nsis-web/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe path: ./dist/nsis-web/Bitwarden-Installer-${{ env.PACKAGE_VERSION }}.exe
if-no-files-found: error
- name: Upload store appx ia32 artifact - name: Upload store appx ia32 artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-ia32-store.appx name: Bitwarden-${{ env.PACKAGE_VERSION }}-ia32-store.appx
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-ia32-store.appx path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-ia32-store.appx
if-no-files-found: error
- name: Upload store appx x64 artifact - name: Upload store appx x64 artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx name: Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-x64-store.appx
if-no-files-found: error
- name: Upload store appx ARM64 artifact - name: Upload store appx ARM64 artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-arm64-store.appx name: Bitwarden-${{ env.PACKAGE_VERSION }}-arm64-store.appx
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-arm64-store.appx path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-arm64-store.appx
if-no-files-found: error
- name: Upload nupkg artifact - name: Upload nupkg artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700 uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
with: with:
name: bitwarden.${{ env.PACKAGE_VERSION }}.nupkg name: bitwarden.${{ env.PACKAGE_VERSION }}.nupkg
path: ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg path: ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg
if-no-files-found: error
macos: macos:
name: MacOS
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- name: Set up Node - name: Set up Node
@ -339,7 +340,7 @@ jobs:
run: ./scripts/safari-build.ps1 -copyonly run: ./scripts/safari-build.ps1 -copyonly
- name: Build application (dev) - name: Build application (dev)
if: github.ref != 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref != 'refs/heads/master' || github.ref != 'refs/heads/rc'
run: npm run build run: npm run build
- name: Build application (dist) - name: Build application (dist)
@ -355,6 +356,7 @@ jobs:
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip name: Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}-mac.zip
if-no-files-found: error
- name: Upload .dmg artifact - name: Upload .dmg artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
@ -362,6 +364,7 @@ jobs:
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}.dmg name: Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}.dmg path: ./dist/Bitwarden-${{ env.PACKAGE_VERSION }}.dmg
if-no-files-found: error
- name: Load Safari extension for App Store - name: Load Safari extension for App Store
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc'
@ -383,3 +386,4 @@ jobs:
with: with:
name: Bitwarden-${{ env.PACKAGE_VERSION }}-universal.pkg name: Bitwarden-${{ env.PACKAGE_VERSION }}-universal.pkg
path: ./dist/mas-universal/Bitwarden-${{ env.PACKAGE_VERSION }}-universal.pkg path: ./dist/mas-universal/Bitwarden-${{ env.PACKAGE_VERSION }}-universal.pkg
if-no-files-found: error

View File

@ -6,13 +6,10 @@ on:
release_tag_name_input: release_tag_name_input:
description: "Release Tag Name <X.X.X>" description: "Release Tag Name <X.X.X>"
required: true required: true
release:
types:
- published
jobs: jobs:
setup: setup:
name: Setup
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
package_version: ${{ steps.create_tags.outputs.package_version }} package_version: ${{ steps.create_tags.outputs.package_version }}
@ -52,7 +49,6 @@ jobs:
env: env:
RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }} RELEASE_TAG_NAME_INPUT: ${{ github.event.inputs.release_tag_name_input }}
snap: snap:
name: Deploy Snap name: Deploy Snap
runs-on: ubuntu-latest runs-on: ubuntu-latest
@ -69,10 +65,10 @@ jobs:
with: with:
snapcraft_token: ${{ secrets.SNAP_TOKEN }} snapcraft_token: ${{ secrets.SNAP_TOKEN }}
- name: setup - name: Setup
run: mkdir dist run: mkdir dist
- name: get snap package - name: Get snap package
uses: Xotl/cool-github-releases@16c58a5863d6ba9944f63ca8bb78bb3249ce1d81 uses: Xotl/cool-github-releases@16c58a5863d6ba9944f63ca8bb78bb3249ce1d81
with: with:
mode: download mode: download
@ -80,7 +76,7 @@ jobs:
assets: bitwarden_${{ env.PKG_VERSION }}_amd64.snap|./dist/bitwarden_${{ env.PKG_VERSION }}_amd64.snap assets: bitwarden_${{ env.PKG_VERSION }}_amd64.snap|./dist/bitwarden_${{ env.PKG_VERSION }}_amd64.snap
github_token: ${{ secrets.GITHUB_TOKEN }} github_token: ${{ secrets.GITHUB_TOKEN }}
- name: test - name: Test
run: ls -alht dist run: ls -alht dist
- name: Deploy to Snap Store - name: Deploy to Snap Store
@ -88,7 +84,6 @@ jobs:
snapcraft upload dist/bitwarden_${{ env.PKG_VERSION }}_amd64.snap --release stable snapcraft upload dist/bitwarden_${{ env.PKG_VERSION }}_amd64.snap --release stable
snapcraft logout snapcraft logout
choco: choco:
name: Deploy Choco name: Deploy Choco
runs-on: windows-latest runs-on: windows-latest
@ -113,7 +108,7 @@ jobs:
env: env:
CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }} CHOCO_API_KEY: ${{ secrets.CHOCO_API_KEY }}
- name: make dist dir - name: Make dist dir
shell: pwsh shell: pwsh
run: New-Item -ItemType directory -Path ./dist run: New-Item -ItemType directory -Path ./dist
@ -131,8 +126,8 @@ jobs:
cd dist cd dist
choco push choco push
macos: macos:
name: Deploy MacOS
runs-on: macos-latest runs-on: macos-latest
needs: setup needs: setup
env: env:
@ -142,10 +137,10 @@ jobs:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
- name: make target directory - name: Make target directory
run: mkdir -p dist/mas-universal run: mkdir -p dist/mas-universal
- name: Get mac release asset - name: Get Mac release asset
uses: Xotl/cool-github-releases@16c58a5863d6ba9944f63ca8bb78bb3249ce1d81 uses: Xotl/cool-github-releases@16c58a5863d6ba9944f63ca8bb78bb3249ce1d81
with: with:
mode: download mode: download
@ -158,3 +153,24 @@ jobs:
env: env:
APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }} APPLE_ID_USERNAME: ${{ secrets.APPLE_ID_USERNAME }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }} APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
publish:
name: Publish Release
runs-on: ubuntu-latest
needs:
- setup
- snap
- choco
- macos
env:
RELEASE_VERSION: ${{ needs.setup.outputs.release_version }}
TAG_VERSION: ${{ needs.setup.outputs.tag_version }}
steps:
- name: Publish release
run: |
hub release edit \
--draft=false \
--message "" \
$TAG_VERSION
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@ -10,9 +10,9 @@ on:
description: 'Browser Extension ref (defaults to `master`):' description: 'Browser Extension ref (defaults to `master`):'
default: master default: master
jobs: jobs:
setup: setup:
name: Setup
runs-on: ubuntu-latest runs-on: ubuntu-latest
outputs: outputs:
release_upload_url: ${{ steps.create_release.outputs.upload_url }} release_upload_url: ${{ steps.create_release.outputs.upload_url }}
@ -59,8 +59,8 @@ jobs:
draft: true draft: true
prerelease: false prerelease: false
linux: linux:
name: Linux
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: setup needs: setup
steps: steps:
@ -106,8 +106,8 @@ jobs:
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
windows-signed: windows-signed:
name: Windows Signed
runs-on: windows-latest runs-on: windows-latest
needs: setup needs: setup
steps: steps:
@ -212,8 +212,8 @@ jobs:
asset_path: ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg asset_path: ./dist/chocolatey/bitwarden.${{ env.PACKAGE_VERSION }}.nupkg
asset_content_type: application asset_content_type: application
windows-store: windows-store:
name: Windows Store
runs-on: windows-latest runs-on: windows-latest
needs: setup needs: setup
steps: steps:
@ -290,6 +290,7 @@ jobs:
asset_content_type: application asset_content_type: application
macos: macos:
name: MacOS
runs-on: macos-latest runs-on: macos-latest
needs: setup needs: setup
steps: steps: