-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from tonkeeper/feature/cd
Desktop PR workflow
- Loading branch information
Showing
9 changed files
with
265 additions
and
65 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
name: Tonkeeper Desktop CD | ||
on: | ||
push: | ||
tags: | ||
- v* | ||
jobs: | ||
desktop-build: | ||
name: desktop-build | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-13] | ||
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 }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DEBUG: electron* | ||
with: | ||
cmd: publish: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 }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DEBUG: electron* | ||
with: | ||
cmd: publish: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 }} | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
DEBUG: electron* | ||
with: | ||
cmd: publish:universal | ||
dir: 'apps/desktop' | ||
|
||
- name: Clean-up credentials | ||
if: always() && runner.os == 'macOS' | ||
run: | | ||
security delete-keychain build.keychain | ||
rm ${{ github.workspace }}/AuthKey.p8 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
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 |
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
Binary file not shown.
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
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
Oops, something went wrong.