-
Notifications
You must be signed in to change notification settings - Fork 2
141 lines (120 loc) · 4.38 KB
/
Copy pathrelease.yml
File metadata and controls
141 lines (120 loc) · 4.38 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
name: Release
# On a version tag, build self-contained binaries and publish a GitHub Release
# carrying: the Windows installer (Inno Setup), a portable win-x64 zip, a
# linux-x64 tarball, and a SHA256SUMS file. The portable archives and their
# checksums are what the Scoop manifest and Homebrew formula consume.
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
windows:
name: Build Windows (win-x64)
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Verify version and read from codebase
id: version
shell: pwsh
run: |
./build/verify-version.ps1 -Tag "${{ github.ref_name }}"
$version = ([xml](Get-Content Directory.Build.props)).Project.PropertyGroup.Version |
Where-Object { $_ } | Select-Object -First 1
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Publish self-contained win-x64
shell: pwsh
run: |
dotnet publish src/Host/Fuse.Cli/Fuse.Cli.csproj `
--configuration Release `
/p:PublishProfile=runtime-win-x64 `
/p:Version=${{ steps.version.outputs.VERSION }}
- name: Package portable zip
shell: pwsh
run: |
New-Item -ItemType Directory -Path dist -Force | Out-Null
Compress-Archive -Path artifacts/runtime/win-x64/fuse.exe `
-DestinationPath "dist/fuse-${{ steps.version.outputs.VERSION }}-win-x64.zip" -Force
- name: Stage installer binary
shell: pwsh
run: |
New-Item -ItemType Directory -Path publish/win-x64 -Force | Out-Null
Copy-Item artifacts/runtime/win-x64/fuse.exe publish/win-x64/fuse.exe -Force
- name: Build installer with Inno Setup
shell: pwsh
run: |
& "C:\Program Files (x86)\Inno Setup 6\ISCC.exe" `
/DMyAppVersion=${{ steps.version.outputs.VERSION }} `
installer/fuse.iss
Copy-Item "publish/installer/fuse-${{ steps.version.outputs.VERSION }}-setup.exe" dist/ -Force
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows
path: dist/*
linux:
name: Build Linux (linux-x64)
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '10.0.x'
- name: Install Linux publish prerequisites
run: |
sudo apt-get update
sudo apt-get install -y clang zlib1g-dev
- name: Verify version and read from codebase
id: version
shell: pwsh
run: |
./build/verify-version.ps1 -Tag "${{ github.ref_name }}"
$version = ([xml](Get-Content Directory.Build.props)).Project.PropertyGroup.Version |
Where-Object { $_ } | Select-Object -First 1
echo "VERSION=$version" >> $env:GITHUB_OUTPUT
- name: Publish self-contained linux-x64
run: |
dotnet publish src/Host/Fuse.Cli/Fuse.Cli.csproj \
--configuration Release \
/p:PublishProfile=runtime-linux-x64 \
/p:Version=${{ steps.version.outputs.VERSION }}
- name: Package tarball
run: |
mkdir -p dist
tar -czf "dist/fuse-${{ steps.version.outputs.VERSION }}-linux-x64.tar.gz" \
-C artifacts/runtime/linux-x64 fuse
- name: Upload Linux artifacts
uses: actions/upload-artifact@v4
with:
name: linux
path: dist/*
release:
name: Publish GitHub Release
needs: [windows, linux]
runs-on: ubuntu-latest
steps:
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
path: dist
merge-multiple: true
- name: Generate SHA256SUMS
working-directory: dist
run: sha256sum * > SHA256SUMS.txt
- name: Create GitHub Release and upload assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Fuse ${{ github.ref_name }}
draft: false
prerelease: ${{ contains(github.ref_name, '-') }}
generate_release_notes: true
files: dist/*