-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (84 loc) · 2.69 KB
/
make.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
name: make
on:
push:
branches:
- 'main'
workflow_dispatch:
env:
VERSION: 1.0.${{ github.run_number }} # 动态版本号,基于当前工作流运行次数
jobs:
linux:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version
run: |
sed -i "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
- name: Install dependencies with Yarn
run: yarn install
- name: Build for Linux
run: |
yarn make
- name: Upload Linux Artifact
uses: actions/upload-artifact@v4
with:
name: linux-${{ env.VERSION }}
path: out/make
windows:
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version
run: |
powershell -Command "(gc .\package.json) -replace '0.0.0', '$($env:VERSION)' | Set-Content .\package.json"
- name: Install dependencies with Yarn
run: yarn install
- name: Build for Windows
run: yarn make
- name: Upload Windows Artifact
uses: actions/upload-artifact@v4
with:
name: windows-${{ env.VERSION }}
path: out/make
macos:
runs-on: macos-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set version
run: |
sed -i '' "s/\"version\": \".*\"/\"version\": \"$VERSION\"/" package.json
- name: Install dependencies with Yarn
run: yarn install
- name: Build for macOS
run: yarn make
- name: Upload macOS Artifact
uses: actions/upload-artifact@v4
with:
name: macos-${{ env.VERSION }}
path: out/make
release:
needs: [linux, windows, macos]
runs-on: ubuntu-latest
steps:
- name: Download Artifact
uses: actions/download-artifact@v4
- name: GH Release
uses: softprops/action-gh-release@v2
with:
files: |
macos-${{ env.VERSION }}/zip/darwin/arm64/GitHelper-darwin-arm64-${{ env.VERSION }}.zip
macos-${{ env.VERSION }}/GitHelper-${{ env.VERSION }}-arm64.dmg
windows-${{ env.VERSION }}/squirrel.windows/x64/GitHelper-${{ env.VERSION }} Setup.exe
windows-${{ env.VERSION }}/squirrel.windows/x64/GitHelper-${{ env.VERSION }}-full.nupkg
linux-${{ env.VERSION }}/deb/x64/githelper_${{ env.VERSION }}_amd64.deb
linux-${{ env.VERSION }}/rpm/x64/GitHelper-${{ env.VERSION }}-1.x86_64.rpm
tag_name: ${{ env.VERSION }}