-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (70 loc) · 2.67 KB
/
release.yml
File metadata and controls
80 lines (70 loc) · 2.67 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build-and-release:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Set version in csproj from tag
run: |
VERSION="${GITHUB_REF#refs/tags/v}"
echo "Setting version to $VERSION in csproj"
sed -i 's|<Version>.*</Version>|<Version>'"$VERSION"'</Version>|' TyranoScriptMemoryUnlocker.csproj
echo "VERSION=$VERSION" >> $GITHUB_ENV
# - name: Restore dependencies
# run: dotnet restore tsmu/TyranoScriptMemoryUnlocker.csproj
- name: Publish Windows x64 (self-contained, single file, trimmed, compressed)
run: |
dotnet publish . \
--configuration Release \
--runtime win-x64 \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishTrimmed=true \
/p:EnableCompressionInSingleFile=true \
/p:PublishReadyToRun=false \
/p:DebugType=None \
/p:DebugSymbols=false \
/p:StripSymbols=true \
--output ./publish/win-x64
- name: Publish Linux x64 (self-contained, single file, trimmed, compressed)
run: |
dotnet publish . \
--configuration Release \
--runtime linux-x64 \
--self-contained true \
/p:PublishSingleFile=true \
/p:PublishTrimmed=true \
/p:EnableCompressionInSingleFile=true \
/p:PublishReadyToRun=false \
/p:DebugType=None \
/p:DebugSymbols=false \
/p:StripSymbols=true \
--output ./publish/linux-x64
# Find the output executable names
- name: Zip Windows
id: winexe
run: |
zip -j ./publish/win-x64/tsmu-win-x64-${{ env.VERSION }}.zip ./publish/win-x64/tsmu.exe ./LICENSE ./README.md
echo "file=./publish/win-x64/tsmu-win-x64-${{ env.VERSION }}.zip" >> $GITHUB_OUTPUT
- name: Tar and gzip Linux
id: linuxexe
run: |
tar -cvf - ./publish/linux-x64/tsmu ./LICENSE ./README.md | gzip -9 > ./publish/linux-x64/tsmu-linux-x64-${{ env.VERSION }}.tar.gz
echo "file=./publish/linux-x64/tsmu-linux-x64-${{ env.VERSION }}.tar.gz" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
token: ${{ secrets.PUBLISH_RELEASES_TOKEN }}
files: |
${{ steps.winexe.outputs.file }}
${{ steps.linuxexe.outputs.file }}