-
Notifications
You must be signed in to change notification settings - Fork 1
126 lines (109 loc) · 3.32 KB
/
Copy pathfeat-test-release.yml
File metadata and controls
126 lines (109 loc) · 3.32 KB
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
name: Test Build (feat/test)
on:
push:
branches:
- "feat/test"
workflow_dispatch:
permissions:
contents: write
jobs:
build-desktop:
name: Build Desktop (${{ matrix.platform }})
strategy:
matrix:
include:
- os: macos-latest
platform: mac
command: build:mac
- os: windows-latest
platform: win
command: build:win
- os: ubuntu-latest
platform: linux
command: build:linux
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
env:
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
run: pnpm install --no-frozen-lockfile
- name: Build Desktop App
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: pnpm --filter @bookdock/desktop run ${{ matrix.command }}
- name: Upload Release Assets (Draft)
uses: softprops/action-gh-release@v2
with:
tag_name: test-build
name: Test Build (feat/test)
draft: true
files: |
apps/desktop/release/*.dmg
apps/desktop/release/*.zip
apps/desktop/release/*.exe
apps/desktop/release/*.AppImage
apps/desktop/release/*.deb
apps/desktop/release/*.blockmap
apps/desktop/release/latest*.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-android:
name: Build Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "zulu"
java-version: "17"
- name: Setup Android SDK
uses: android-actions/setup-android@v3
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: "pnpm"
- name: Install dependencies
env:
NPM_CONFIG_REGISTRY: https://registry.npmjs.org/
run: pnpm install --no-frozen-lockfile
- name: Build Android APK
run: |
cd apps/mobile/android
chmod +x gradlew
./gradlew assembleRelease
- name: Rename and Prepare APK
id: prepare_apk
run: |
VERSION=$(node -p "require('./apps/mobile/app.json').expo.version")
OLD_PATH="apps/mobile/android/app/build/outputs/apk/release/app-release.apk"
NEW_NAME="BookDock-${VERSION}-test.apk"
NEW_PATH="apps/mobile/android/app/build/outputs/apk/release/${NEW_NAME}"
mv "$OLD_PATH" "$NEW_PATH"
echo "apk_path=$NEW_PATH" >> $GITHUB_OUTPUT
- name: Upload Release Assets (Draft)
uses: softprops/action-gh-release@v2
with:
tag_name: test-build
name: Test Build (feat/test)
draft: true
files: |
${{ steps.prepare_apk.outputs.apk_path }}
token: ${{ secrets.GITHUB_TOKEN }}