web/.github/workflows/desktop.release.reuse.yml

214 lines
7.4 KiB
YAML
Raw Normal View History

2022-06-14 01:31:02 +03:00
name: Desktop Reusable Release Workflow
2022-06-12 04:37:41 +03:00
on:
2022-06-14 01:10:08 +03:00
workflow_call:
inputs:
channel:
required: true
type: string
2022-06-12 04:37:41 +03:00
jobs:
Mac:
runs-on: macos-latest
2022-06-13 16:35:49 +03:00
env:
CSC_LINK: ${{ secrets.MAC_CI_KEYS }}
CSC_KEY_PASSWORD: ${{ secrets.MAC_CI_KEYS_PASSWORD }}
NOTARIZE_APPLE_ID: ${{ secrets.NOTARIZE_APPLE_ID }}
NOTARIZE_APPLE_ID_PASSWORD: ${{ secrets.NOTARIZE_APPLE_ID_PASSWORD }}
2022-06-12 04:48:33 +03:00
defaults:
run:
2022-06-12 15:02:38 +03:00
working-directory: packages/desktop
2022-06-12 04:37:41 +03:00
steps:
- uses: actions/checkout@v3
2022-06-20 19:07:32 +03:00
- uses: actions/setup-node@v3
2022-06-12 16:42:05 +03:00
with:
registry-url: 'https://registry.npmjs.org'
2022-07-05 18:34:30 +03:00
node-version-file: '.nvmrc'
2022-06-12 17:54:36 +03:00
- run: yarn install
- run: yarn build:desktop
2022-06-17 19:32:36 +03:00
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
2022-06-12 04:37:41 +03:00
- name: Compile Mac
run: yarn run webpack --config desktop.webpack.prod.js
- name: MacX64
2022-06-12 04:42:01 +03:00
run: |
2022-06-17 19:32:36 +03:00
yarn run electron-builder --mac --x64 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-13 17:08:32 +03:00
node scripts/fixMacZip.js
2022-06-12 04:37:41 +03:00
- name: MacArm64
2022-06-17 19:32:36 +03:00
run: yarn run electron-builder --mac --arm64 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: Upload
uses: actions/upload-artifact@v3.0.0
with:
name: assets
2022-06-12 22:52:05 +03:00
path: |
packages/desktop/dist/*.dmg
packages/desktop/dist/*.zip
packages/desktop/dist/*.blockmap
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
2022-06-12 04:37:41 +03:00
Linux:
runs-on: ubuntu-latest
2022-06-12 04:48:33 +03:00
defaults:
run:
2022-06-12 15:02:38 +03:00
working-directory: packages/desktop
2022-06-12 04:37:41 +03:00
steps:
- uses: actions/checkout@v3
2022-06-20 19:07:32 +03:00
- uses: actions/setup-node@v3
2022-06-12 16:42:05 +03:00
with:
registry-url: 'https://registry.npmjs.org'
2022-07-05 18:34:30 +03:00
node-version-file: '.nvmrc'
2022-06-13 06:33:56 +03:00
- name: Set up Ruby
uses: ruby/setup-ruby@v1
- name: Install FPM
run: sudo gem install fpm -f
2022-06-12 17:54:36 +03:00
- run: yarn install
- run: yarn build:desktop
2022-06-17 19:32:36 +03:00
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
2022-06-12 04:37:41 +03:00
- name: Compile for AppImage
run: yarn run webpack --config desktop.webpack.prod.js
- name: AppImage
2022-06-17 19:32:36 +03:00
run: yarn run electron-builder --linux --x64 --ia32 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: AppImageX64
2022-06-17 19:32:36 +03:00
run: yarn run electron-builder --linux --x64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: AppImageArm64
2022-06-17 19:32:36 +03:00
run: yarn run electron-builder --linux --arm64 -c.linux.target=AppImage --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: Deb
2022-06-12 04:42:01 +03:00
run: |
yarn run webpack --config desktop.webpack.prod.js --env deb
2022-06-17 19:32:36 +03:00
yarn run electron-builder --linux --x64 --ia32 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: DebArm64
env:
npm_config_target_arch: 'arm64'
USE_SYSTEM_FPM: 'true'
2022-06-12 04:42:01 +03:00
run: |
yarn run webpack --config desktop.webpack.prod.js --env deb
2022-06-17 19:32:36 +03:00
yarn run electron-builder --linux --arm64 -c.linux.target=deb --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: Dir
2022-06-12 04:42:01 +03:00
run: |
yarn run webpack --config desktop.webpack.prod.js
2022-06-17 19:32:36 +03:00
yarn run electron-builder --linux --x64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: DirArm64
2022-06-12 04:42:01 +03:00
run: |
yarn run webpack --config desktop.webpack.prod.js
2022-06-17 19:32:36 +03:00
yarn run electron-builder --linux --arm64 -c.linux.target=dir --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
env:
npm_config_target_arch: 'arm64'
- name: Snap
2022-06-12 04:42:01 +03:00
run: |
2022-06-13 16:05:11 +03:00
sudo snap install snapcraft --classic
2022-06-12 15:48:44 +03:00
yarn run webpack --config desktop.webpack.prod.js --env snap
2022-06-17 19:32:36 +03:00
yarn run electron-builder --linux --x64 -c.linux.target=snap --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: Upload
uses: actions/upload-artifact@v3.0.0
with:
name: assets
2022-06-12 22:52:05 +03:00
path: |
packages/desktop/dist/*.snap
packages/desktop/dist/*.AppImage
packages/desktop/dist/*.deb
packages/desktop/dist/*.blockmap
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
2022-06-12 04:37:41 +03:00
Windows:
2022-06-14 01:10:08 +03:00
runs-on: self-hosted
env:
WINDOWS_TOKEN_ALIAS: ${{ secrets.WINDOWS_TOKEN_ALIAS }}
WINDOWS_TOKEN_PASSWORD: ${{ secrets.WINDOWS_TOKEN_PASSWORD }}
2022-06-12 04:48:33 +03:00
defaults:
run:
2022-06-12 15:02:38 +03:00
working-directory: packages/desktop
2022-06-12 04:37:41 +03:00
steps:
- uses: actions/checkout@v3
2022-06-20 19:07:32 +03:00
- uses: actions/setup-node@v3
2022-06-12 16:42:05 +03:00
with:
registry-url: 'https://registry.npmjs.org'
2022-07-05 18:34:30 +03:00
node-version-file: '.nvmrc'
2022-06-12 17:54:36 +03:00
- run: yarn install
- run: yarn build:desktop
2022-06-12 04:37:41 +03:00
- run: yarn run webpack --config desktop.webpack.prod.js
2022-06-17 19:32:36 +03:00
- run: echo APP_VERSION=$(node -p "require('./package.json').version") >> $GITHUB_ENV
- run: yarn run electron-builder --windows --x64 --ia32 --publish=never --c.extraMetadata.version=${{ env.APP_VERSION }}
2022-06-12 04:37:41 +03:00
- name: Upload
uses: actions/upload-artifact@v3.0.0
with:
name: assets
2022-06-12 22:52:05 +03:00
path: |
packages/desktop/dist/*.blockmap
packages/desktop/dist/*.exe
packages/desktop/dist/*.yml
packages/desktop/dist/*.yaml
2022-06-12 04:37:41 +03:00
Publish:
runs-on: ubuntu-latest
2022-06-14 01:31:02 +03:00
if: ${{ always() }}
needs: [Windows, Mac, Linux]
2022-06-12 04:48:33 +03:00
defaults:
run:
2022-06-12 15:02:38 +03:00
working-directory: packages/desktop
2022-06-12 04:37:41 +03:00
steps:
- uses: actions/checkout@v3
2022-06-20 19:07:32 +03:00
- uses: actions/setup-node@v3
2022-06-12 16:42:05 +03:00
with:
registry-url: 'https://registry.npmjs.org'
2022-07-05 18:34:30 +03:00
node-version-file: '.nvmrc'
2022-06-17 16:56:10 +03:00
2022-07-01 16:19:30 +03:00
- run: yarn install
2022-06-12 04:37:41 +03:00
- uses: actions/download-artifact@v3
with:
name: assets
2022-06-12 16:01:50 +03:00
path: packages/desktop/dist
- name: Generate Checksums
run: node scripts/sums.mjs
2022-06-12 17:54:36 +03:00
- name: get-npm-version
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: packages/desktop
- name: Generate Release Notes
2022-07-03 15:56:56 +03:00
uses: ./actions/release-notes
with:
package: web desktop
2022-06-24 19:20:15 +03:00
id: release-notes
continue-on-error: true
2022-06-12 17:54:36 +03:00
- name: Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.CI_PAT_TOKEN }}
tag_name: "@standardnotes/desktop@${{ steps.package-version.outputs.current-version}}"
name: "Desktop ${{ steps.package-version.outputs.current-version }}"
2022-07-03 15:56:56 +03:00
body: ${{ steps.release-notes.outputs.result }}
2022-06-12 17:54:36 +03:00
prerelease: true
draft: false
2022-06-12 22:48:20 +03:00
files: packages/desktop/dist/*
- name: Notify Release Update
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.CI_PAT_TOKEN }}
repository: ${{ secrets.RELEASES_EVENT_RECEIVING_REPO }}
event-type: releases-updated-event
- name: Publish Snap
continue-on-error: true
run: |
sudo snap install snapcraft --classic
echo "${{ secrets.SNAPCRAFT_LOGIN_FILE }}" >> snapauth.txt
snapcraft login --with=snapauth.txt
2022-07-06 19:43:35 +03:00
snapcraft upload dist/standard-notes-${{ steps.package-version.outputs.current-version}}-linux-amd64.snap --release stable,candidate,beta,edge