-
-
Notifications
You must be signed in to change notification settings - Fork 0
216 lines (185 loc) · 8.14 KB
/
release-apps.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
###############################################################################
# RELEASE APPS
###############################################################################
name: 🚀🖥️ Release APPs
on:
workflow_dispatch:
inputs:
version:
description: 'Set number for release version'
type: string
required: true
env:
GITHUB_TOKEN: ${{ github.token }}
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
REPO_TEST: ${{ github.repository }}:test
REPO_LATEST: ${{ github.repository }}:latest
###############################################################################
# JOBS
###############################################################################
jobs:
release_apps:
permissions:
contents: write
deployments: write
strategy:
fail-fast: false
matrix:
settings:
- platform: 'macos-13-xlarge'
tauriScript: 'pnpm tauri'
# args: '--target universal-apple-darwin'
# - platform: 'macos-latest'
# args: '--target x86_64-apple-darwin'
# - platform: 'macos-latest'
# args: '--target aarch64-apple-darwin'
# - platform: 'macos-latest'
- platform: 'ubuntu-22.04'
tauriScript: 'pnpm tauri'
- platform: 'windows-latest'
tauriScript: 'pnpm exec tauri' # this because script tauri has $@ and windows dont support it
timeout-minutes: 20
runs-on: ${{ matrix.settings.platform }}
env:
UPDATED_VERSION: ${{ github.event.inputs.version }}
steps:
#########################################################################
# INIT & INSTALL
#########################################################################
- name: ⬇️ Checkout repository
uses: actions/checkout@v4
- name: 🦀 Rust setup
if: matrix.settings.platform == 'macos-latest'
uses: dtolnay/rust-toolchain@stable
with:
targets: 'aarch64-apple-darwin,x86_64-apple-darwin'
- name: 🦀 Rust setup
if: matrix.settings.platform != 'macos-latest'
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: 🦀 Rust cache
uses: swatinem/rust-cache@v2
with:
workspaces: './src-tauri -> target'
- name: 📦 Install pnpm
uses: pnpm/action-setup@v2
id: pnpm-install
- name: 📦 Sync node version and setup cache
uses: actions/setup-node@v4
with:
node-version: 'lts/*'
cache: 'pnpm' # Set this to npm, yarn or pnpm.
- name: 📦📄 Get package.json name
id: pkg
run: |
echo "name=$(jq -r '.extra.productName' ./package.json)" >> $GITHUB_OUTPUT
echo "description=$(jq -r '.description' ./package.json)" >> $GITHUB_OUTPUT
echo "homepage=$(jq -r '.homepage' ./package.json)" >> $GITHUB_OUTPUT
echo "docs=$(jq -r '.extra.docsUrl' ./package.json)" >> $GITHUB_OUTPUT
echo "repo=$(jq -r '.repository.url' ./package.json)" >> $GITHUB_OUTPUT
- name: 🦀 install dependencies (ubuntu only)
if: matrix.settings.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
- name: ⬇️📦 Install dependencies
run: |
pnpm install --no-frozen-lockfile
#########################################################################
# BUILD
#########################################################################
# important because app works with the core local package
- name: 🏗 Build
run: pnpm core build && pnpm app build
#########################################################################
# APP - BUILD & RELEASE DESKTOP APP
#########################################################################
- name: 🖥️ Build the app
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
with:
# @see https://github.com/tauri-apps/tauri-action?tab=readme-ov-file#inputs
projectPath: 'packages/app'
tagName: "${{ env.UPDATED_VERSION }}"
releaseName: '${{ steps.pkg.outputs.name }} v${{ env.UPDATED_VERSION }}'
releaseBody: |
${{ steps.pkg.outputs.name }} apps and extensions v${{ env.UPDATED_VERSION }}
${{ steps.pkg.outputs.description }}
---
🌐 WEB: ${{ steps.pkg.outputs.homepage }}
📚 DOCUMENTATION:${{ steps.pkg.outputs.docs }}
🧩 CHANGELOG: ${{ steps.pkg.outputs.repo }}/blob/main/packages/app/CHANGELOG.md
📜 LICENSE: ${{ steps.pkg.outputs.repo }}/blob/main/LICENSE
releaseDraft: false
prerelease: false
includeUpdaterJson: true
updaterJsonKeepUniversal: true # @see https://github.com/tauri-apps/tauri-action?tab=readme-ov-file#build-options
includeRelease: true
tauriScript: ${{ matrix.settings.tauriScript }}
# args: ${{ matrix.settings.args }}
#########################################################################
# APP - PUBLISH WEB
#########################################################################
- name: 🖥️🌥 Deploy APP in cloudflare pages
if: matrix.settings.platform == 'ubuntu-22.04'
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
branch: main
projectName: "super8"
directory: 'packages/app/build'
wranglerVersion: '3'
#########################################################################
# APP - PUSH DOCKER IMAGE
#########################################################################
- name: 🐳☑️ Set up QEMU
if: matrix.settings.platform == 'ubuntu-22.04'
uses: docker/setup-qemu-action@v1
- name: 🐳☑️ Set up Docker Buildx
uses: docker/setup-buildx-action@v1
if: matrix.settings.platform == 'ubuntu-22.04'
- name: 🐳 Login to Docker Hub
if: matrix.settings.platform == 'ubuntu-22.04'
uses: docker/login-action@v1
with:
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: 🐳🚀 Build and push image
if: matrix.settings.platform == 'ubuntu-22.04'
uses: docker/build-push-action@v4
with:
context: packages/app
push: true
platforms: linux/amd64,linux/arm64
tags: |
${{ github.repository }}:${{ env.UPDATED_VERSION }}
${{ env.REPO_LATEST }}
- name: 🐳📝 Update Docker Hub metadata
if: matrix.settings.platform == 'ubuntu-22.04'
uses: docker/metadata-action@v3
with:
images: ${{ github.repository }}:${{ env.UPDATED_VERSION }},$${{ env.REPO_LATEST }}
# description: ${{ steps.pkg.outputs.description }}
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_ACCESS_TOKEN }}
- name: 🐳📝 Update Docker Hub repo description
if: matrix.settings.platform == 'ubuntu-22.04'
uses: peter-evans/dockerhub-description@v3
with:
# @see https://github.com/peter-evans/dockerhub-description
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
repository: ${{ github.repository }}
short-description: ${{ steps.pkg.outputs.description }}
readme-filepath: ./README.md
###############################################################################