-
Notifications
You must be signed in to change notification settings - Fork 3
79 lines (67 loc) · 2.4 KB
/
tag-and-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
name: Build and Release
on:
push:
tags:
- 'v*'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.x
- name: Install dependencies
run: dotnet restore
- name: Publish application
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
echo "PUBLISHING FOR LINUX"
dotnet publish -c Release -r linux-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
else
echo "PUBLISHING FOR WINDOWS"
dotnet publish -c Release -r win-x64 /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true --self-contained true
fi
- name: Create ZIP file
run: |
if [ ${{ matrix.os }} == "ubuntu-latest" ]; then
zip -r --junk-paths FikaServerTools_${{ github.ref_name }}-linux64.zip ./bin/Release/net8.0/linux-x64/publish/
else
zip -r --junk-paths FikaServerTools_${{ github.ref_name }}-windows64.zip ./bin/Release/net8.0/win-x64/publish/
fi
shell: bash
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: FikaServerTools_${{ matrix.os }}_${{ github.ref_name }}
path: FikaServerTools_${{ github.ref_name }}-*.zip
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts (Linux)
uses: actions/download-artifact@v4
with:
name: FikaServerTools_ubuntu-latest_${{ github.ref_name }}
path: ./dist/linux
- name: Download artifacts (Windows)
uses: actions/download-artifact@v4
with:
name: FikaServerTools_windows-latest_${{ github.ref_name }}
path: ./dist/windows
- name: Publish pre-release
id: create_release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "Fika-ServerTools ${{ github.ref_name }}"
prerelease: true
files: |
./dist/linux/FikaServerTools_${{ github.ref_name }}-linux64.zip
./dist/windows/FikaServerTools_${{ github.ref_name }}-windows64.zip