-
Notifications
You must be signed in to change notification settings - Fork 4
173 lines (139 loc) · 4.61 KB
/
release.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
name: Release
on:
push:
tags:
- 'v*'
paths-ignore:
- 'README.md'
jobs:
create-release:
runs-on: ubuntu-latest
outputs:
id: ${{ steps.create_release.outputs.id }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '16.x'
- run: npm i -g openblock-resource@latest
- name: Pre-process resources
run: |
gen-config --version=${{ github.ref_name }}
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Clear Unused files
run: |
rm -r .git .github buildResources
- name: Zip resources
uses: vimtor/action-zip@v1
with:
files: ./
dest: external-resources-${{ steps.get-version.outputs.VERSION }}.zip
- name: Checksum
run: sha256sum external-resources-*.zip >> ${{ steps.get-version.outputs.VERSION }}-checksums-sha256.txt
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: OpenBlock External Resources ${{ github.ref_name }}
body: |
## Change Log (en)
- **New feature**
1. Feature 1.
2. Feature 2.
- **Fix bug**
1. Bug 1.
2. Bug 2.
## 更改日志 (zh-cn)
- **新功能**
1. 功能1。
2. 功能2。
- **修复错误**
1. 错误1。
2. 错误2。
draft: true
prerelease: false
- name: Upload Zip
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "external-resources-*.zip"
release_id: ${{steps.create_release.outputs.id}}
- name: Upload Checksum
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "*-checksums-sha256.txt"
release_id: ${{steps.create_release.outputs.id}}
build-windows:
needs: create-release
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
- name: Install Inno Setup
shell: powershell
run: |
choco install innosetup
- name: Get version
id: get-version
run: |
$tag = "${{ github.ref_name }}"
$version = $tag.Substring(1)
Write-Output "::set-output name=VERSION::$version"
- name: Build Installer
shell: powershell
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" /dVersion="${{ steps.get-version.outputs.VERSION }}" "./buildResources/setup.iss"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
release_id: ${{needs.create-release.outputs.id}}
build-mac:
needs: create-release
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Build Installer
run: ./buildResources/build-pkg.sh VERSION="${{ steps.get-version.outputs.VERSION }}"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
release_id: ${{needs.create-release.outputs.id}}
build-linux:
needs: create-release
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Get version
id: get-version
run: |
version=`echo ${{ github.ref_name }} | sed -r 's/[v]+//g'`
echo ::set-output name=VERSION::$version
- name: Build Installer
run: ./buildResources/build-deb.sh -v"${{ steps.get-version.outputs.VERSION }}"
- name: Upload to Release
uses: xresloader/upload-to-github-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
file: "./dist/OpenBlock-External-Resources*"
release_id: ${{needs.create-release.outputs.id}}