-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (103 loc) · 3.25 KB
/
Copy pathrelease.yml
File metadata and controls
122 lines (103 loc) · 3.25 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
name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
# The gate: a tag push runs the full CI suite (format, vet, build, test)
# before anything is packaged, and every job below needs it, so a red test
# leaves the release unpublished instead of shipping. Reuses ci.yml rather
# than restating its steps, so the two can't drift apart.
test:
uses: ./.github/workflows/ci.yml
build-macos:
needs: test
strategy:
matrix:
include:
- runner: macos-latest
arch: arm64
- runner: macos-15-intel
arch: x86_64
runs-on: ${{ matrix.runner }}
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Install fyne CLI
run: go install fyne.io/fyne/v2/cmd/fyne@latest
- name: Package macOS app
run: make package-mac
- name: Archive macOS app bundle
run: |
cd bin
zip -r -y "picfetch-macos-$(uname -m).zip" "PicFetch.app"
- name: Upload macOS artifact
uses: actions/upload-artifact@v7
with:
name: picfetch-macos-${{ matrix.arch }}
path: bin/picfetch-macos-*.zip
if-no-files-found: error
build-cross:
needs: test
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Set up Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache-dependency-path: go.sum
- name: Install fyne-cross CLI
run: go install github.com/fyne-io/fyne-cross@latest
- name: Package Windows binary
run: make package-windows
- name: Package Linux binaries
run: make package-linux
- name: Archive artifacts
run: |
cd bin
# The .exe inside each zip stays plain "picfetch.exe" - the archive
# name already carries the arch, and that is what users unpacked
# before Windows gained a second architecture.
for arch in amd64 arm64; do
cp "picfetch-windows-$arch.exe" "picfetch.exe"
zip "picfetch-windows-$arch.zip" "picfetch.exe"
rm "picfetch.exe"
done
for arch in amd64 arm64; do
tar -czf "picfetch-linux-$arch.tar.gz" "picfetch-linux-$arch"
done
- name: Upload Windows/Linux artifacts
uses: actions/upload-artifact@v7
with:
name: picfetch-cross
path: |
bin/picfetch-windows-amd64.zip
bin/picfetch-windows-arm64.zip
bin/picfetch-linux-amd64.tar.gz
bin/picfetch-linux-arm64.tar.gz
if-no-files-found: error
release:
needs: [build-macos, build-cross]
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v7
- name: Download artifacts
uses: actions/download-artifact@v8
with:
path: dist
merge-multiple: true
- name: Create GitHub release
uses: softprops/action-gh-release@v3
with:
files: dist/*
body_path: .github/release-notes.md