-
Notifications
You must be signed in to change notification settings - Fork 286
84 lines (71 loc) · 2.7 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
name: "publish"
on:
push:
branches:
- release
jobs:
cap-desktop-release:
permissions:
contents: write
runs-on: macos-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Create API Key File
run: echo "${{ secrets.APPLE_API_KEY_FILE }}" > api.p8
- name: Rust setup
uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin, aarch64-apple-darwin
- name: Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: "./apps/desktop/src-tauri -> target"
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Install dependencies
run: cd apps/desktop && pnpm install
- name: Get app version
id: get_version
run: echo "appVersion=$(jq -r '.version' apps/desktop/package.json)" >> $GITHUB_OUTPUT
- name: Create .env file in root
run: |
echo "NEXT_PUBLIC_URL=${{ secrets.NEXT_PUBLIC_URL }}" > .env
echo "appVersion=${{ steps.get_version.outputs.appVersion }}" >> .env
echo "NEXT_PUBLIC_ENVIRONMENT=production" >> .env
echo "NEXT_PUBLIC_LOCAL_MODE=false" >> .env
echo "CAP_DESKTOP_SENTRY_URL=https://efd3156d9c0a8a49bee3ee675bec80d8@o4506859771527168.ingest.us.sentry.io/4506859844403200" >> .env
- name: Copy .env to apps/desktop
run: cp .env apps/desktop/.env
- name: Output .env file
run: cat apps/desktop/.env
- name: Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY: ${{ secrets.APPLE_API_KEY }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_API_KEY_PATH: api.p8
with:
projectPath: apps/desktop
args: --target universal-apple-darwin
tagName: cap-v__VERSION__
releaseName: "Cap v__VERSION__"
releaseBody: "The latest version of Cap."
releaseDraft: false
releasePublish: true
prerelease: false