-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add release mac workflow * Update environment for linux * Add cache clean-up --------- Co-authored-by: Ajinkya Rajandekar <[email protected]>
- Loading branch information
1 parent
01676c7
commit 3444fb8
Showing
1 changed file
with
137 additions
and
17 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,56 +1,176 @@ | ||
name: release-dekstop-app | ||
name: release-desktop-app | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*.*.*' | ||
tags: | ||
- "v*.*.*" | ||
|
||
jobs: | ||
create-release-linux: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install GitHub CLI | ||
run: sudo apt-get install gh | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9.9.0 | ||
|
||
- name: Cache turbo build | ||
uses: actions/cache@v4 | ||
with: | ||
path: .turbo | ||
key: turbo-${{ github.sha }} | ||
restore-keys: | | ||
turbo- | ||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.18.0 | ||
cache: 'pnpm' | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Build | ||
run: pnpm build | ||
- name: Build project | ||
working-directory: apps/desktop | ||
run: pnpm turbo build | ||
|
||
create-draft-release: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
environment: "Production – umami-v2" | ||
permissions: | ||
contents: write | ||
issues: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Create Draft Release for ${{ github.ref_name }} | ||
run: gh release create ${{ github.ref_name }} --draft --title "${{ github.ref_name }}" --generate-notes | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
create-release-linux: | ||
runs-on: ubuntu-latest | ||
needs: [build, create-draft-release] | ||
permissions: | ||
contents: write | ||
environment: "Production – umami-v2" | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9.9.0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.18.0 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Create Draft Release | ||
run: gh release create ${{ github.ref }} --draft --title "Release ${{ github.ref }}" --notes-from-tag | ||
- name: Cache turbo build | ||
uses: actions/cache@v4 | ||
with: | ||
path: .turbo | ||
key: turbo-${{ github.sha }} | ||
restore-keys: | | ||
turbo- | ||
- name: Enter desktop app directory | ||
run: cd apps/desktop | ||
- name: Build project | ||
working-directory: apps/desktop | ||
run: pnpm turbo build | ||
|
||
- name: Import GPG key | ||
uses: crazy-max/ghaction-import-gpg@v6 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
fingerprint: ${{secrets.GPG_KEY_ID }} | ||
fingerprint: ${{ secrets.GPG_KEY_ID }} | ||
git_user_signingkey: true | ||
|
||
- name: Generate deb and rpm files | ||
run: pnpm run electron:package:linux | ||
working-directory: apps/desktop | ||
env: | ||
CI: false | ||
run: pnpm electron:package:linux -p never | ||
|
||
- name: Sign the deb and rpm files using dpkg-sig and rpm-sign | ||
working-directory: apps/desktop | ||
run: | | ||
sudo apt install -y dpkg-sig | ||
dpkg-sig --sign builder -k ${{ secrets.GPG_KEY_ID }} ./dist/*.deb | ||
echo "%_gpg_name ${{ secrets.GPG_KEY_ID }}" > ~/.rpmmacros | ||
rpm --addsign ./dist/*.rpm | ||
- name: Upload deb and rpm files | ||
run: gh release upload ${{ github.ref }} ./dist/*.deb ./dist/*.rpm | ||
working-directory: apps/desktop | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh release upload ${{ github.ref_name }} ./dist/*.deb ./dist/*.rpm | ||
|
||
create-release-mac: | ||
runs-on: macos-latest | ||
needs: [build, create-draft-release] | ||
environment: "Production – umami-v2" | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 9.9.0 | ||
|
||
- name: Setup Node.js environment | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20.18.0 | ||
cache: "pnpm" | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Cache turbo build | ||
uses: actions/cache@v4 | ||
with: | ||
path: .turbo | ||
key: turbo-${{ github.sha }} | ||
restore-keys: | | ||
turbo- | ||
- name: Build project | ||
working-directory: apps/desktop | ||
run: pnpm turbo build | ||
|
||
- name: Build and sign mac app | ||
working-directory: apps/desktop | ||
env: | ||
CI: true | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
CSC_LINK: ${{ secrets.CSC_LINK }} | ||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }} | ||
APPLE_ID: ${{ secrets.APPLE_ID }} | ||
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }} | ||
run: pnpm run electron:package:mac | ||
|
||
cleanup-cache: | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [create-release-linux, create-release-mac] | ||
steps: | ||
- name: Check out the code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Cleanup cache | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: gh cache delete turbo-${{ github.sha }} |
3444fb8
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.