-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 2.85 KB
/
release.yml
File metadata and controls
105 lines (91 loc) · 2.85 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
name: Release
on:
push:
tags:
- "*"
permissions:
contents: write
jobs:
build:
name: Build assets (${{ matrix.rid }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
rid: linux-x64
- os: windows-latest
rid: win-x64
- os: windows-latest
rid: win-x86
- os: macos-latest
rid: osx-x64
- os: macos-latest
rid: osx-arm64
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
cache: true
cache-dependency-path: |
**/*.csproj
- name: Restore
run: dotnet restore cge-tools.sln
- name: Publish (Linux/macOS)
if: runner.os != 'Windows'
env:
RID: ${{ matrix.rid }}
run: |
set -euo pipefail
rm -rf dist
dotnet publish CftConverter/CftConverter.csproj -c Release -r "$RID" --self-contained false -o "dist/$RID/cft-converter"
dotnet publish VbmConverter/VbmConverter.csproj -c Release -r "$RID" --self-contained false -o "dist/$RID/vbm-converter"
- name: Package (Linux/macOS)
if: runner.os != 'Windows'
env:
RID: ${{ matrix.rid }}
run: |
set -euo pipefail
cd "dist/$RID"
zip -r "../../cge-tools-$RID.zip" .
- name: Publish (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
RID: ${{ matrix.rid }}
run: |
Remove-Item -Recurse -Force dist -ErrorAction SilentlyContinue
dotnet publish CftConverter/CftConverter.csproj -c Release -r $env:RID --self-contained false -o dist/$env:RID/cft-converter
dotnet publish VbmConverter/VbmConverter.csproj -c Release -r $env:RID --self-contained false -o dist/$env:RID/vbm-converter
- name: Package (Windows)
if: runner.os == 'Windows'
shell: pwsh
env:
RID: ${{ matrix.rid }}
run: |
Compress-Archive -Path dist/$env:RID/* -DestinationPath cge-tools-$env:RID.zip -Force
- name: Upload asset artifact
uses: actions/upload-artifact@v6
with:
name: release-asset-${{ matrix.rid }}
path: cge-tools-${{ matrix.rid }}.zip
release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download assets
uses: actions/download-artifact@v7
with:
path: release-assets
merge-multiple: true
- name: Publish GitHub release
uses: softprops/action-gh-release@v2
with:
files: release-assets/*.zip
fail_on_unmatched_files: true
generate_release_notes: true