-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (77 loc) · 2.51 KB
/
release.yml
File metadata and controls
95 lines (77 loc) · 2.51 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: Release
on:
push:
tags:
- 'v*'
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
artifact: nativegen-linux-x64
- os: windows-latest
rid: win-x64
artifact: nativegen-win-x64.exe
runs-on: ${{ matrix.os }}
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
dotnet-quality: 'preview'
- name: Restore dependencies
run: dotnet restore NativeCodeGen.sln
- name: Publish
run: dotnet publish src/NativeCodeGen.Cli/NativeCodeGen.Cli.csproj -c Release -r ${{ matrix.rid }} -o ./publish
- name: Rename artifact (Unix)
if: runner.os != 'Windows'
run: |
mv ./publish/nativegen ./publish/${{ matrix.artifact }}
chmod +x ./publish/${{ matrix.artifact }}
- name: Rename artifact (Windows)
if: runner.os == 'Windows'
run: move .\publish\nativegen.exe .\publish\${{ matrix.artifact }}
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: ./publish/${{ matrix.artifact }}
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-musl:
runs-on: ubuntu-latest
container: mcr.microsoft.com/dotnet/sdk:10.0-preview-alpine
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- name: Install build dependencies
run: apk add --no-cache clang build-base zlib-dev
- name: Restore dependencies
run: dotnet restore NativeCodeGen.sln
- name: Publish
run: dotnet publish src/NativeCodeGen.Cli/NativeCodeGen.Cli.csproj -c Release -r linux-musl-x64 -o ./publish
- name: Rename artifact
run: |
mv ./publish/nativegen ./publish/nativegen-linux-musl-x64
chmod +x ./publish/nativegen-linux-musl-x64
- name: Upload to Release
uses: softprops/action-gh-release@v2
with:
files: ./publish/nativegen-linux-musl-x64
generate_release_notes: true
draft: false
prerelease: ${{ contains(github.ref, '-') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}