Repository navigation
82 lines (68 loc) · 2.22 KB
/
Copy pathrelease.yml
File metadata and controls
82 lines (68 loc) · 2.22 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
name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Wails
run: go install github.com/wailsapp/wails/v2/cmd/wails@latest
- name: Install frontend dependencies
run: npm install
working-directory: frontend
- name: Get version
id: version
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
shell: bash
- name: Update version in wails.json
run: |
$content = Get-Content wails.json -Raw
$content = $content -replace '"productVersion": "0.0.0"', '"productVersion": "${{ steps.version.outputs.VERSION }}"'
Set-Content wails.json $content
shell: pwsh
- name: Build
run: wails build -platform windows/amd64 -ldflags "-s -w -X main.Version=${{ github.ref_name }}"
- name: Install UPX
run: choco install upx -y
- name: Compress with UPX
run: upx --best --lzma build/bin/fs-mod-sync.exe
- name: Generate changelog
id: changelog
run: |
$previous_tag = git describe --tags --abbrev=0 HEAD^ 2>$null
if ($LASTEXITCODE -ne 0) {
$commits = git log --pretty=format:"- %s (%h)" ${{ github.ref_name }}
} else {
$commits = git log --pretty=format:"- %s (%h)" "$previous_tag..${{ github.ref_name }}"
}
$commits = $commits -replace '"', '\"'
$commits = $commits -replace "`r`n", "`n"
"CHANGELOG<<EOF" >> $env:GITHUB_OUTPUT
$commits >> $env:GITHUB_OUTPUT
"EOF" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: build/bin/fs-mod-sync.exe
body: |
## Changes
${{ steps.changelog.outputs.CHANGELOG }}
draft: false
prerelease: false