-
-
Notifications
You must be signed in to change notification settings - Fork 1
96 lines (83 loc) · 2.51 KB
/
ci.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
on:
push:
tags:
- '**'
workflow_dispatch:
name: Build tagged releases
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
build:
name: Build
runs-on: Ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
- linux-x64
- osx-arm64
- osx-x64
- win-x64
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install .NET 8.0.x
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
- name: Create publish package (push)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: dotnet publish -c Release -r ${{matrix.os}} /p:Version="${{ github.sha }}" --self-contained -warnaserror osu.Desktop.slnf
- name: Create publish package (tagged release)
if: ${{ startsWith(github.ref, 'refs/tags/') }}
env:
REF: ${{ github.ref }}
run: dotnet publish -c Release -r ${{matrix.os}} /p:Version="${REF##*/}" --self-contained -warnaserror osu.Desktop.slnf
- name: tar releases (for *nix platforms)
if: ${{ !startsWith(matrix.os, 'win') }}
run: tar -cvzf ${{matrix.os}}.tar.gz osu.Desktop/bin/Release/net8.0/${{matrix.os}}
- uses: actions/upload-artifact@v4
name: upload artifacts (windows)
if: ${{ startsWith(matrix.os, 'win') }}
with:
name: ${{matrix.os}}
path: osu.Desktop/bin/Release/net8.0/${{matrix.os}}
- uses: actions/upload-artifact@v4
name: upload artifacts (*nix)
if: ${{ !startsWith(matrix.os, 'win') }}
with:
name: ${{matrix.os}}
path: ${{matrix.os}}.tar.gz
release:
name: Release
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: Ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: zip releases
run: |
for directory in */
do
zip -r "${directory::-1}.zip" "$directory"
done
- name: delete artifacts
uses: geekyeggo/delete-artifact@v5
with:
name: |
win-x64
linux-x64
osx-arm64
osx-x64
- name: Release
uses: softprops/action-gh-release@v2
with:
generate_release_notes: true
files: ./*