-
Notifications
You must be signed in to change notification settings - Fork 0
96 lines (91 loc) · 2.96 KB
/
dotnet-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
name: dotnet-release
on:
push:
tags:
- v**
env:
dotnet-version: '8.0.x'
jobs:
windows-x64-release:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Install project dependencies
run: dotnet restore
- run: mkdir \app
- name: Compile exectuable
run: dotnet publish -r windows-x64 -c Release -o \app\ CloseAsteroids.csproj
- name: Zip executable
shell: Powershell
run: Compress-Archive -Path app\* -Destination windows-x64.zip
- name: Upload windows zip artifact
uses: actions/upload-artifact@v4
with:
name: windows-x64
path: windows-x64.zip
macos-x64-release:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Install project dependencies
run: dotnet restore
- run: mkdir /app
- name: Compile exectuable
run: dotnet publish -r macos-x64 -c Release -o /app/ CloseAsteroids.csproj
- name: Zip executable
shell: Powershell
run: Compress-Archive -Path app/* -Destination macos-x64.zip
- name: Upload macos zip artifact
uses: actions/upload-artifact@v4
with:
name: macos-x64
path: macos-x64.zip
linux-x64-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.dotnet-version }}
- name: Install project dependencies
run: dotnet restore
- name: Install dotnet AOT dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
clang zlib1g-dev
- run: sudo mkdir /app
- name: Compile exectuable
run: dotnet publish -r linux-x64 -c Release -o /app/ CloseAsteroids.csproj
- name: Zip executable
shell: Powershell
run: Compress-Archive -Path app/* -Destination linux-x64.zip
- name: Download All Artifacts
uses: actions/download-artifact@v4
- name: Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
name: ${{ github.ref_name }}
token: ${{ secrets.RELEASE_TOKEN }}
generate_release_notes: true
files: |
windows-x64.zip
macos-x64.zip
linux-x64.zip
- name: Delete artifacts
uses: geekyeggo/delete-artifact@v5
if: always()
with:
name: |
windows-x64
macos-x64