Repository navigation
147 lines (140 loc) · 5.43 KB
/
Copy pathrelease.yml
File metadata and controls
147 lines (140 loc) · 5.43 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
name: Release
on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
tag:
description: "Tag to release, for example v0.1.0"
required: true
permissions:
contents: write
env:
TAG: ${{ github.event.inputs.tag || github.ref_name }}
jobs:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --workspace
- name: Package
shell: pwsh
run: |
$version = "$env:TAG".TrimStart("v")
New-Item -ItemType Directory -Force -Path out | Out-Null
Copy-Item target/release/swmm_loader.dll target/release/swmm.dll
Compress-Archive -Path target/release/swmm.exe, target/release/swmm.dll, LICENSE -DestinationPath "out/swmm-x86_64-windows.zip"
dotnet tool install --global wix --version 5.0.2
wix extension add -g WixToolset.UI.wixext/5.0.2
wix build assets/installer/swmm.wxs -ext WixToolset.UI.wixext -pdbtype none -arch x64 -d Version=$version -d Bin=target/release -d Assets=assets -o "out/swmm-x86_64-windows.msi"
- uses: actions/upload-artifact@v4
with:
name: windows
path: out/*
linux:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- name: Dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgtk-3-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev libssl-dev pkg-config
- name: Build
run: cargo build --release --workspace
- name: Package
run: |
mkdir -p out stage
cp target/release/swmm LICENSE stage/
cp assets/icon.png stage/swmm.png
tar -cJf "out/swmm-x86_64-linux.tar.xz" -C stage .
- uses: actions/upload-artifact@v4
with:
name: linux
path: out/*
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88.0
- uses: Swatinem/rust-cache@v2
- name: Build
run: cargo build --release --workspace
- name: Package
run: |
mkdir -p out stage
cp target/release/swmm LICENSE stage/
cp assets/icon.png stage/swmm.png
tar -cJf "out/swmm-aarch64-macos.tar.xz" -C stage .
- uses: actions/upload-artifact@v4
with:
name: macos
path: out/*
release:
needs: [windows, linux, macos]
if: ${{ !cancelled() && needs.windows.result == 'success' && needs.linux.result == 'success' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: out
merge-multiple: true
- name: Install scripts, checksums and notes
run: |
repo="${{ github.repository }}"
base="https://github.com/$repo/releases/download/$TAG"
sed -e "s#__REPO__#$repo#g" -e "s#__TAG__#$TAG#g" assets/installer/swmm-installer.ps1 > out/install.ps1
sed -e "s#__REPO__#$repo#g" -e "s#__TAG__#$TAG#g" assets/installer/swmm-installer.sh > out/install.sh
cd out
sha256sum swmm-* install.* > SHA256SUMS.txt
version="${TAG#v}"
{
echo ""
echo
echo "**Savage Wind Mod Manager $version**. Install, merge and play Breath of the Wild mods on Savage Wind."
echo
echo "## Downloads"
echo
echo "| Platform | File | Notes |"
echo "| --- | --- | --- |"
echo "| Windows | [swmm-x86_64-windows.msi]($base/swmm-x86_64-windows.msi) | Installer, recommended |"
echo "| Windows | [swmm-x86_64-windows.zip]($base/swmm-x86_64-windows.zip) | Portable, no installation needed |"
echo "| Linux and Steam Deck | [swmm-x86_64-linux.tar.xz]($base/swmm-x86_64-linux.tar.xz) | Archive |"
if [ -f swmm-aarch64-macos.tar.xz ]; then
echo "| macOS, Apple silicon | [swmm-aarch64-macos.tar.xz]($base/swmm-aarch64-macos.tar.xz) | Archive, not signed |"
fi
echo
echo "## Install with one command"
echo
echo "Windows, in PowerShell:"
echo
echo '```powershell'
echo "irm $base/install.ps1 | iex"
echo '```'
echo
echo "Linux, in a terminal:"
echo
echo '```sh'
echo "curl -fsSL $base/install.sh | sh"
echo '```'
echo
echo "## Checksums"
echo
echo "SHA-256 checksums for every file are listed in [SHA256SUMS.txt]($base/SHA256SUMS.txt)."
} > ../notes.md
- name: Publish
env:
GH_TOKEN: ${{ github.token }}
run: |
if gh release view "$TAG" --repo "${{ github.repository }}" >/dev/null 2>&1; then
gh release edit "$TAG" --repo "${{ github.repository }}" --title "SWMM $TAG" --notes-file notes.md
gh release upload "$TAG" out/* --repo "${{ github.repository }}" --clobber
else
gh release create "$TAG" out/* --repo "${{ github.repository }}" --title "SWMM $TAG" --notes-file notes.md --target "${{ github.sha }}"
fi