-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (69 loc) · 2.08 KB
/
deploy.yml
File metadata and controls
85 lines (69 loc) · 2.08 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
name: Deploy to GitHub Pages
on:
push:
branches: [ "main" ]
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make gradlew executable
run: chmod +x gradlew
- name: Build with Gradle
# 使用 WasmJS 目标进行构建
run: ./gradlew :composeApp:wasmJsBrowserDistribution
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# WasmJS 产物路径
path: composeApp/build/dist/wasmJs/productionExecutable
build-desktop:
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Make gradlew executable
if: runner.os != 'Windows'
run: chmod +x gradlew
- name: Build Desktop Binary
run: ./gradlew :composeApp:packageDistributionForCurrentOS
if: runner.os != 'Windows'
- name: Build Desktop Binary
run: .\gradlew.bat :composeApp:packageDistributionForCurrentOS
if: runner.os == 'Windows'
- name: Upload Desktop Artifact
uses: actions/upload-artifact@v4
with:
name: desktop-binary-${{ matrix.os }}
path: composeApp/build/compose/binaries/main/
deploy:
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4