Skip to content

Commit 382b77f

Browse files
committed
feat: publish workflow
1 parent efb4997 commit 382b77f

2 files changed

Lines changed: 155 additions & 13 deletions

File tree

.github/workflows/release.yml

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
tag:
10+
description: 'Release tag (e.g., v0.0.6)'
11+
required: true
12+
type: string
13+
14+
jobs:
15+
build-macos:
16+
name: Build macOS (${{ matrix.arch }})
17+
runs-on: macos-latest
18+
strategy:
19+
matrix:
20+
arch: [arm64, x64]
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v4
28+
with:
29+
version: 10.13.1
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: '24'
35+
cache: 'pnpm'
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Download Node.js binaries
41+
working-directory: apps/desktop
42+
run: pnpm download-node:all
43+
44+
- name: Import Developer ID cert
45+
uses: apple-actions/import-codesign-certs@v3
46+
with:
47+
p12-file-base64: ${{ secrets.DEVELOPER_CERT_BASE64 }}
48+
p12-password: ${{ secrets.DEVELOPER_CERT_PASSPHRASE }}
49+
50+
- name: List signing identities (debug)
51+
run: security find-identity -v -p codesigning
52+
53+
- name: Build artifacts
54+
working-directory: apps/desktop
55+
env:
56+
SKIP_CODESIGNING: false
57+
SKIP_NOTARIZATION: false
58+
APPLE_ID: ${{ secrets.APPLE_ID }}
59+
APPLE_APP_PASSWORD: ${{ secrets.APPLE_APP_PASSWORD }}
60+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
61+
CODESIGNING_IDENTITY: ${{ secrets.CODESIGNING_IDENTITY }}
62+
run: |
63+
# Now make the distributables
64+
pnpm make:${{ matrix.arch }}
65+
66+
- name: Get version from package.json
67+
id: package_version
68+
working-directory: apps/desktop
69+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
70+
71+
- name: Upload artifacts
72+
uses: actions/upload-artifact@v4
73+
with:
74+
name: macos-${{ matrix.arch }}
75+
path: |
76+
apps/desktop/out/make/*-${{ matrix.arch }}.dmg
77+
apps/desktop/out/make/zip/darwin/${{ matrix.arch }}/*.zip
78+
79+
release:
80+
name: Create Release
81+
needs: build-macos
82+
runs-on: ubuntu-latest
83+
permissions:
84+
contents: write
85+
86+
steps:
87+
- name: Checkout code
88+
uses: actions/checkout@v4
89+
90+
- name: Get version from package.json
91+
id: package_version
92+
working-directory: apps/desktop
93+
run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
94+
95+
- name: Download all artifacts
96+
uses: actions/download-artifact@v4
97+
with:
98+
path: artifacts
99+
100+
- name: List artifacts
101+
run: |
102+
echo "=== Full artifacts directory structure ==="
103+
find artifacts -type f -name "*.dmg" -o -name "*.zip" | sort
104+
echo ""
105+
echo "=== Detailed file listing ==="
106+
find artifacts -type f \( -name "*.dmg" -o -name "*.zip" \) -exec ls -la {} \;
107+
108+
- name: Create Release
109+
uses: softprops/action-gh-release@v2
110+
with:
111+
draft: true
112+
prerelease: true
113+
tag_name: ${{ github.event.inputs.tag || github.ref_name }}
114+
name: Amical Desktop v${{ steps.package_version.outputs.version }}
115+
body: |
116+
## Amical Desktop v${{ steps.package_version.outputs.version }}
117+
118+
### What's New
119+
- Please update this section with actual changes
120+
121+
### Downloads
122+
123+
#### macOS
124+
- **Apple Silicon (M1/M2/M3)**: Download the DMG or ZIP file for arm64
125+
- **Intel**: Download the DMG or ZIP file for x64
126+
127+
### Installation
128+
129+
**macOS**:
130+
- **DMG**: Download and open the DMG file, then drag Amical to your Applications folder
131+
- **ZIP**: Download and extract the ZIP file, then drag Amical to your Applications folder
132+
133+
The ZIP files are primarily for automatic updates. We recommend using the DMG files for initial installation.
134+
files: |
135+
artifacts/macos-arm64/*.dmg
136+
artifacts/macos-arm64/zip/darwin/arm64/*.zip
137+
artifacts/macos-x64/*.dmg
138+
artifacts/macos-x64/zip/darwin/x64/*.zip
139+
env:
140+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

apps/desktop/package.json

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@amical/desktop",
3-
"version": "0.0.5",
3+
"version": "0.0.5-test-publish",
44
"description": "Amical Desktop app",
55
"main": ".vite/build/main.js",
66
"productName": "Amical",
@@ -9,26 +9,28 @@
99
"url": "https://github.com/amicalhq/amical"
1010
},
1111
"scripts": {
12-
"start": "pnpm build:swift-helper && electron-forge start",
12+
"start": "pnpm build:deps && electron-forge start",
1313
"start:onboarding": "FORCE_ONBOARDING=true pnpm start",
14-
"package": "pnpm build:swift-helper && electron-forge package",
15-
"make": "pnpm build:swift-helper && electron-forge make --platform=darwin --arch=x64,arm64",
16-
"make:arm64": "pnpm build:swift-helper && electron-forge make --platform=darwin --arch=arm64",
17-
"make:x64": "pnpm build:swift-helper && electron-forge make --platform=darwin --arch=x64",
18-
"make:dmg": "pnpm build:swift-helper && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=arm64,x64",
19-
"make:dmg:arm64": "pnpm build:swift-helper && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=arm64",
20-
"make:dmg:x64": "pnpm build:swift-helper && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=x64",
21-
"make:zip:arm64": "pnpm build:swift-helper && electron-forge make --targets=@electron-forge/maker-zip --platform=darwin --arch=arm64",
22-
"make:zip:x64": "pnpm build:swift-helper && electron-forge make --targets=@electron-forge/maker-zip --platform=darwin --arch=x64",
23-
"package:arm64": "pnpm build:swift-helper && electron-forge package --platform=darwin --arch=arm64",
24-
"package:x64": "pnpm build:swift-helper && electron-forge package --platform=darwin --arch=x64",
14+
"package": "pnpm build:deps && electron-forge package",
15+
"make": "pnpm build:deps && electron-forge make",
16+
"make:arm64": "pnpm build:deps && electron-forge make --platform=darwin --arch=arm64",
17+
"make:x64": "pnpm build:deps && electron-forge make --platform=darwin --arch=x64",
18+
"make:dmg": "pnpm build:deps && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=arm64,x64",
19+
"make:dmg:arm64": "pnpm build:deps && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=arm64",
20+
"make:dmg:x64": "pnpm build:deps && electron-forge make --targets=@electron-forge/maker-dmg --platform=darwin --arch=x64",
21+
"make:zip:arm64": "pnpm build:deps && electron-forge make --targets=@electron-forge/maker-zip --platform=darwin --arch=arm64",
22+
"make:zip:x64": "pnpm build:deps && electron-forge make --targets=@electron-forge/maker-zip --platform=darwin --arch=x64",
23+
"package:arm64": "pnpm build:deps && electron-forge package --platform=darwin --arch=arm64",
24+
"package:x64": "pnpm build:deps && electron-forge package --platform=darwin --arch=x64",
2525
"publish": "electron-forge publish",
2626
"lint": "eslint --ext .ts,.tsx .",
2727
"format:check": "prettier --check \"**/*.{ts,tsx,md,json,mjs,mts,css,mdx}\" --cache --ignore-path=../../.prettierignore",
2828
"ts:check": "tsc --noEmit",
2929
"db:generate": "drizzle-kit generate",
3030
"db:push": "drizzle-kit push",
3131
"db:migrate": "drizzle-kit migrate",
32+
"build:deps": "pnpm build:types && pnpm build:swift-helper",
33+
"build:types": "pnpm --filter @amical/types build",
3234
"build:swift-helper": "pnpm --filter @amical/swift-helper build",
3335
"dev": "pnpm start",
3436
"download-node": "tsx scripts/download-node-binaries.ts",

0 commit comments

Comments
 (0)