-
Notifications
You must be signed in to change notification settings - Fork 4
149 lines (139 loc) · 5.39 KB
/
release.yml
File metadata and controls
149 lines (139 loc) · 5.39 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
name: NitroPacker Release
on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: true
type: 'string'
release_notes:
description: 'Release Notes'
required: true
type: 'string'
skip_nuget:
description: 'Skip NuGet Publish'
required: true
default: false
type: 'boolean'
jobs:
build-and-publish:
name: 'Build & Publish'
strategy:
matrix:
platform:
- image: 'ubuntu-latest'
artifact_name: 'NitroPacker-Linux-x64-${{ inputs.version }}'
rid: 'linux-x64'
artifact_suffix: '.tar.gz'
- image: 'ubuntu-24.04-arm'
artifact_name: 'NitroPacker-Linux-arm64-${{ inputs.version }}'
rid: 'linux-arm64'
artifact_suffix: '.tar.gz'
- image: 'macos-latest'
artifact_name: 'NitroPacker-macOS-arm64-${{ inputs.version }}'
rid: 'osx-arm64'
artifact_suffix: '.tar.gz'
- image: 'macos-latest'
artifact_name: 'NitroPacker-macOS-x64-${{ inputs.version }}'
rid: 'osx-x64'
artifact_suffix: '.tar.gz'
- image: 'windows-latest'
artifact_name: 'NitroPacker-Windows-x64-${{ inputs.version }}'
rid: 'win-x64'
artifact_suffix: '.zip'
- image: 'windows-11-arm'
artifact_name: 'NitroPacker-Windows-arm64-${{ inputs.version }}'
rid: 'win-arm64'
artifact_suffix: '.zip'
runs-on: ${{ matrix.platform.image }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v5.0.0
with:
dotnet-version: '10.0.x'
- name: Build & Publish NitroPacker
run: dotnet publish HaroohieClub.NitroPacker.Cli/HaroohieClub.NitroPacker.Cli.csproj -c Release -f net10.0 -r ${{ matrix.platform.rid }} --self-contained /p:PublishSingleFile=true
- name: Build & Publish SymTableHelper
run: dotnet publish HaroohieClub.NitroPacker.SymTableHelper/HaroohieClub.NitroPacker.SymTableHelper.csproj -c Release -f net10.0 -r ${{ matrix.platform.rid }} --self-contained /p:PublishSingleFile=true
- name: Create tar
if: ${{ matrix.platform.artifact_suffix == '.tar.gz' }}
shell: pwsh
run: |
Push-Location HaroohieClub.NitroPacker.Cli/bin/Release/net10.0/${{ matrix.platform.rid }}/publish
chmod +x ./NitroPacker
chmod +x ./NitroPacker.SymTableHelper
tar -czvf ../${{ matrix.platform.artifact_name }}${{ matrix.platform.artifact_suffix }} ./
Pop-Location
- name: Create zip
if: ${{ matrix.platform.artifact_suffix == '.zip' }}
shell: pwsh
run: |
Push-Location -Path HaroohieClub.NitroPacker.Cli/bin/Release/net10.0/${{ matrix.platform.rid }}/publish
Compress-Archive -Path .\ -DestinationPath ..\${{ matrix.platform.artifact_name }}${{ matrix.platform.artifact_suffix }}
Pop-Location
- name: 'Upload artifact'
uses: actions/upload-artifact@v6
with:
name: ${{ matrix.platform.artifact_name }}
path: HaroohieClub.NitroPacker.Cli/bin/Release/net10.0/${{ matrix.platform.rid }}/${{ matrix.platform.artifact_name }}${{ matrix.platform.artifact_suffix }}
retention-days: 1
publish-package:
name: 'Publish NuGet Package'
if: ${{ !inputs.skip_nuget }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
submodules: true
- name: Setup .NET
uses: actions/setup-dotnet@v5.0.0
with:
dotnet-version: '10.0.x'
- run: |
dotnet pack HaroohieClub.NitroPacker/HaroohieClub.NitroPacker.csproj
dotnet nuget push -s nuget.org -k ${{ secrets.API_NUGET_KEY }} HaroohieClub.NitroPacker/bin/Release/HaroohieClub.NitroPacker.${{ inputs.version }}.nupkg
release:
runs-on: ubuntu-latest
needs: [ build-and-publish ]
steps:
- name: Download Linux x64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-Linux-x64-${{ inputs.version }}
- name: Download Linux ARM64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-Linux-arm64-${{ inputs.version }}
- name: Download macOS ARM64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-macOS-arm64-${{ inputs.version }}
- name: Download macOS ARM64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-macOS-x64-${{ inputs.version }}
- name: Download macOS x64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-macOS-x64-${{ inputs.version }}
- name: Download Windows x64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-Windows-x64-${{ inputs.version }}
- name: Download Windows ARM64
uses: actions/download-artifact@v4.1.8
with:
name: NitroPacker-Windows-arm64-${{ inputs.version }}
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: NitroPacker v${{ inputs.version }}
tag_name: ${{ inputs.version }}
generate_release_notes: true
files: ./*
body: ${{ inputs.release_notes }}