-
Notifications
You must be signed in to change notification settings - Fork 28
167 lines (146 loc) · 7.05 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
name: Release
on:
push:
tags:
- "v*.*.*"
jobs:
generate-changelog:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.12.6
- name: Setup Python environment
run: |
python -m venv .venv
source .venv/bin/activate
pip install requests
- name: Generate release-changelog
run: |
source .venv/bin/activate
python Scripts/generate_release.py "$(git log -1 --pretty=%B)" version_info.txt gamebanana_changelog.json github_changelog.md studio_changelog.md
env:
GITHUB_REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ github.token }}
- name: Upload version information
uses: actions/upload-artifact@v4
with:
name: changelog-version
path: version_info.txt
- name: Upload GameBanana changelog
uses: actions/upload-artifact@v4
with:
name: changelog-gamebanana
path: gamebanana_changelog.json
- name: Upload GitHub changelog
uses: actions/upload-artifact@v4
with:
name: changelog-github
path: github_changelog.md
- name: Upload Studio changelog
uses: actions/upload-artifact@v4
with:
name: changelog-studio
path: studio_changelog.md
build-studio:
uses: ./.github/workflows/Build.CelesteStudio.yml
with:
build-cfg: Release
needs: generate-changelog
release:
runs-on: ubuntu-latest
needs:
- build-studio
- generate-changelog
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0'
- name: Setup Python
uses: actions/[email protected]
with:
python-version: 3.12.6
- name: Setup Firefox WebDriver
uses: browser-actions/[email protected]
- name: Download Studio builds
uses: actions/download-artifact@v4
with:
pattern: CelesteStudio-*
- name: Move Studio builds into correct location
run: |
mv CelesteStudio-windows-x64/CelesteStudio-windows-x64.zip .
mv CelesteStudio-linux-x64/CelesteStudio-linux-x64.zip .
mv CelesteStudio-macos-x64/CelesteStudio-macos-x64.zip .
mv CelesteStudio-macos-arm64/CelesteStudio-macos-arm64.zip .
- name: Fill-in download info
run: |
sed -i "s\\false; //DOUBLE_ZIP_ARCHIVE\\false;\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##STUDIO_VERSION##\\$(perl -nle 'print $1 if /<Version>(\S+)<\/Version>/' Studio/CelesteStudio/CelesteStudio.csproj)\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##URL_WINDOWS_x64##\\https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/CelesteStudio-windows-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##URL_LINUX_x64##\\https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/CelesteStudio-linux-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##URL_MACOS_x64##\\https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/CelesteStudio-macos-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##URL_MACOS_ARM64##\\https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/CelesteStudio-macos-arm64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##FILENAME_WINDOWS_x64##\\CelesteStudio-windows-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##FILENAME_LINUX_x64##\\CelesteStudio-linux-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##FILENAME_MACOS_x64##\\CelesteStudio-macos-x64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##FILENAME_MACOS_ARM64##\\CelesteStudio-macos-arm64.zip\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##CHECKSUM_WINDOWS_x64##\\$(md5sum CelesteStudio-windows-x64.zip | head -c 32)\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##CHECKSUM_LINUX_x64##\\$(md5sum CelesteStudio-linux-x64.zip | head -c 32)\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##CHECKSUM_MACOS_x64##\\$(md5sum CelesteStudio-macos-x64.zip | head -c 32)\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
sed -i "s\\##CHECKSUM_MACOS_ARM64##\\$(md5sum CelesteStudio-macos-arm64.zip | head -c 32)\\" CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
cat CelesteTAS-EverestInterop/Source/EverestInterop/StudioHelper.cs
- name: Build
run: |
dotnet build CelesteTAS-EverestInterop -c Release -p:DefineConstants=INSTALL_STUDIO -p:UseSymlinks=false
- name: Download changelogs
uses: actions/download-artifact@v4
with:
pattern: changelog-*
- name: Setup Python environment
run: |
python -m venv .venv
source .venv/bin/activate
pip install requests selenium
- name: Prepare releases
run: |
# Version GameBanana .zip without v prefix
RELEASE_FILE="CelesteTAS_$(head -n 1 changelog-version/version_info.txt | cut -c 2-).zip"
cp CelesteTAS.zip $RELEASE_FILE
echo "RELEASE_FILE=$RELEASE_FILE" >> $GITHUB_ENV
# Setup GitHub release title
RELEASE_TITLE="$(sed -n "1p" changelog-version/version_info.txt) (Studio $(sed -n "2p" changelog-version/version_info.txt))"
echo "RELEASE_TITLE=$RELEASE_TITLE" >> $GITHUB_ENV
- name: Upload GameBanana release
run: |
source .venv/bin/activate
python Scripts/gamebanana_upload.py ${{ env.RELEASE_FILE }} changelog-gamebanana/gamebanana_changelog.json changelog-version/version_info.txt
env:
GAMEBANANA_USERNAME: AutomaticRelease
GAMEBANANA_PASSWORD: ${{ secrets.GAMEBANANA_PASSWORD }}
GAMEBANANA_2FA_URI: ${{ secrets.GAMEBANANA_2FA_URI }}
GAMEBANANA_MODID: 6715
GAMEBANANA_ISTOOL: 1
- name: Upload GitHub release
uses: softprops/action-gh-release@v1
with:
name: ${{ env.RELEASE_TITLE }}
body_path: changelog-github/github_changelog.md
files: |
CelesteTAS.zip
CelesteStudio-windows-x64.zip
CelesteStudio-linux-x64.zip
CelesteStudio-macos-x64.zip
CelesteStudio-macos-arm64.zip
- name: Clean-up changelog artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: changelog-*
failOnError: false