-
Notifications
You must be signed in to change notification settings - Fork 4
217 lines (183 loc) · 5.63 KB
/
create_release.yml
File metadata and controls
217 lines (183 loc) · 5.63 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
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
217
name: Release (Multiple Arch)
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
build_release:
name: Run Make Build
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Cache Go Modules
uses: actions/cache@v5
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }}
restore-keys: |
go-mod-${{ runner.os }}-
- name: Run Make
run: make BUILD_TYPE=RELEASE
- name: Tree Dir
run: tree
- name: Upload Artifacts
uses: actions/upload-artifact@v6
with:
name: build_artifacts
path: build
build_win_installer:
needs: build_release
runs-on: windows-latest
name: Build Windows Installer (INNO)
permissions: write-all
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Read Version
id: read_version
shell: pwsh
run: |
$TAG = git describe --tags --abbrev=0
echo "Current tag: $TAG"
echo "V_TAG=$TAG" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: build_artifacts
github-token: ${{ secrets.GITHUB_TOKEN }}
path: build/
- name: Rename Binary
shell: cmd
run: ren build\chibi_${{ env.V_TAG }}_win_amd64.exe chibi.exe
- name: Pack Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.7
env:
V_TAG: ${{ env.V_TAG }}
with:
path: installer_scripts\chibi_setup.iss
options: /O+
- name: Move installer to build dir
shell: cmd
run: move installer_scripts\Output\chibi_${{ env.V_TAG }}_installer.exe build\
- name: Rename Binary (Again)
shell: cmd
run: ren build\chibi.exe chibi_${{ env.V_TAG }}_win_amd64.exe
- name: Upload Installer Artifacts
uses: actions/upload-artifact@v4
with:
name: build_artifacts_with_installer
path: build
create_release:
name: Publish new Release
needs: build_win_installer
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Read Version
id: read_version
run: |
TAG=$(git describe --tags --abbrev=0)
echo "Current tag: $TAG"
echo "tag=$TAG" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: build_artifacts_with_installer
github-token: ${{ secrets.GITHUB_TOKEN }}
path: build/
- name: Tree Dir
run: tree
# TODO: Uncomment this at the end
- name: Create Release
id: create-release
uses: comnoco/create-release-action@v2.0.5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag }}
release_name: Version ${{ env.tag }} 🔖
body_path: ./CHANGELOG.md
draft: false
prerelease: false
- name: Upload Artifacts to Release
uses: AButler/upload-release-assets@v3.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
release-tag: ${{ env.tag }}
files: "build/*"
publish_to_winget:
needs: create_release
permissions: write-all
runs-on: windows-latest
name: Publish installer to WinGet
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Publish to WinGet
uses: vedantmgoyal9/winget-releaser@main
with:
identifier: CosmicPredator.Chibi
installers-regex: '.*_installer\.exe$'
token: ${{ secrets.WINGET_TOKEN }}
publish_to_snap_store:
needs: create_release
runs-on: ubuntu-latest
name: Publish to Snap Store
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Read Tag
id: read_version
run: |
TAG=$(git describe --tags --abbrev=0)
echo "Current tag: $TAG"
echo "tag=$TAG" >> $GITHUB_ENV
- name: Download Artifact
uses: actions/download-artifact@v7
with:
name: build_artifacts_with_installer
github-token: ${{ secrets.GITHUB_TOKEN }}
path: build/
- name: Rename Linux Binary
run: |
mv build/chibi_${{ env.tag }}_linux_amd64 build/chibi
sudo chmod 777 build/chibi
echo "Rename binary successful"
- name: Move snapcraft.yaml file to root
run: |
mv installer_scripts/snapcraft.yaml snapcraft.yaml
echo "version: ${{ env.tag }}" >> snapcraft.yaml
- name: Install Snapcraft
run: |
sudo snap install snapcraft --classic
- name: Setup LXD
uses: canonical/setup-lxd@main
with:
group: lxd
- name: Build snap
run: |
sudo usermod -a -G lxd $USER
sudo snapcraft
- name: Upload snap to Snap Store
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }}
run: |
sudo snap install snapcraft --classic
snapcraft upload *.snap --release=candidate