Desktop PR workflow #2
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: Tonkeeper Desktop Distributives | |
on: | |
workflow_dispatch: | |
pull_request: | |
jobs: | |
desktop-build: | |
name: desktop-build | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-13, windows-latest] | |
node-version: [20.7.0] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout to git repository | |
uses: actions/checkout@v4 | |
- name: Set up Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Enable Corepack | |
run: | | |
corepack enable | |
- name: Decode service account into a file | |
if: runner.os == 'macOS' | |
env: | |
CREDENTIALS: ${{ secrets.APPLE_API_KEY }} | |
run: | | |
echo $CREDENTIALS | base64 -d > ${{ github.workspace }}/AuthKey.p8 | |
- name: Configure keychain | |
if: runner.os == 'macOS' | |
env: | |
IDENTITY_PASSPHRASE: ${{ secrets.IDENTITY_PASSPHRASE }} | |
IDENTITY_P12_B64: ${{ secrets.IDENTITY_P12_B64 }} | |
run: | | |
echo $IDENTITY_P12_B64 | base64 -d > DS_ID_App.p12 | |
security create-keychain -p $IDENTITY_PASSPHRASE build.keychain | |
security unlock-keychain -p $IDENTITY_PASSPHRASE build.keychain | |
security list-keychains -d user -s build.keychain | |
security default-keychain -s build.keychain | |
security import DS_ID_App.p12 -k build.keychain -P $IDENTITY_PASSPHRASE -A -T /usr/bin/codesign | |
security set-key-partition-list -S apple-tool:,apple: -s -k $IDENTITY_PASSPHRASE build.keychain | |
- name: Run install | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: install | |
- name: Run build packages | |
uses: borales/actions-yarn@v4 | |
with: | |
cmd: build:pkg | |
- name: Run build intel distributive | |
uses: borales/actions-yarn@v4 | |
env: | |
APPLE_API_KEY: ${{ github.workspace }}/AuthKey.p8 | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
REACT_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE }} | |
DEBUG: electron* | |
with: | |
cmd: make:intel | |
dir: 'apps/desktop' | |
- name: Run build arm distributive | |
uses: borales/actions-yarn@v4 | |
env: | |
APPLE_API_KEY: ${{ github.workspace }}/AuthKey.p8 | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
REACT_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE }} | |
DEBUG: electron* | |
with: | |
cmd: make:arm | |
dir: 'apps/desktop' | |
- name: Run build universal distributive | |
if: runner.os == 'macOS' | |
uses: borales/actions-yarn@v4 | |
env: | |
APPLE_API_KEY: ${{ github.workspace }}/AuthKey.p8 | |
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }} | |
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }} | |
REACT_APP_AMPLITUDE: ${{ secrets.REACT_APP_AMPLITUDE }} | |
DEBUG: electron* | |
with: | |
cmd: make:universal | |
dir: 'apps/desktop' | |
- name: Upload distributives to artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Tonkeeper Desktop ${{ runner.os }} | |
retention-days: 10 | |
path: | | |
${{ github.workspace }}/apps/desktop/out/make | |
- name: Clean-up credentials | |
if: always() && runner.os == 'macOS' | |
run: | | |
security delete-keychain build.keychain | |
rm ${{ github.workspace }}/AuthKey.p8 |