Merge pull request #703 from nature-heart-software/dev #127
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
release: | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Create changelog for release | |
id: github_release | |
uses: mikepenz/release-changelog-builder-action@v1 | |
with: | |
configuration: 'changelog.config.json' | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Update release | |
uses: ncipollo/release-action@v1 | |
with: | |
allowUpdates: true | |
body: ${{ steps.github_release.outputs.changelog }} | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{ contains(github.ref, 'rc') || contains(github.ref, 'beta') || contains(github.ref, 'alpha')}} | |
deploy: | |
needs: [release] | |
strategy: | |
matrix: | |
os: [windows-2022] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 16.x | |
registry-url: 'https://npm.pkg.github.com' | |
cache: 'yarn' | |
- name: Add msbuild to PATH | |
uses: microsoft/[email protected] | |
with: | |
vs-version: '16.11' | |
- name: Set env variables | |
shell: bash | |
run: | | |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set package.json version | |
uses: wurielle/package-version-action@v1 | |
with: | |
version: ${{ env.RELEASE_VERSION }} | |
targets: | | |
./package.json | |
./apps/app/package.json | |
- name: Build | |
uses: borales/actions-yarn@v4 | |
env: | |
NODE_OPTIONS: '--max_old_space_size=4096' | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
VUE_APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }} | |
VITE_APP_ENCRYPTION_KEY: ${{ secrets.APP_ENCRYPTION_KEY }} | |
with: | |
cmd: build | |
- name: Cleanup electron dist | |
shell: bash | |
working-directory: apps/app/dist_electron | |
run: | | |
rm -rf win-unpacked linux-unpacked mac builder-debug.yml bundled | |
ls -l ./ | |
- name: Upload artifacts to Release | |
uses: alexellis/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
asset_paths: '["./apps/app/dist_electron/*"]' | |
- name: Rollback Release | |
if: failure() | |
uses: author/action-rollback@stable | |
with: | |
tag: ${{ env.RELEASE_VERSION }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |