-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (48 loc) · 1.31 KB
/
Copy pathrelease.yml
File metadata and controls
57 lines (48 loc) · 1.31 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
name: Build and Release
permissions:
contents: write
on:
release:
types: [published]
jobs:
build:
name: Build binaries
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, windows, darwin]
goarch: [amd64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
- name: Build
run: |
mkdir -p dist
ext=""
if [ "${{ matrix.goos }}" = "windows" ]; then ext=".exe"; fi
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/ptc-${{ matrix.goos }}-${{ matrix.goarch }}$ext
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ptc-${{ matrix.goos }}-${{ matrix.goarch }}
path: dist/ptc-${{ matrix.goos }}-${{ matrix.goarch }}*
release:
name: Upload to GitHub Release
needs: build
runs-on: ubuntu-latest
steps:
- name: Download all build artifacts
uses: actions/download-artifact@v4
with:
path: dist
- name: List files for debug
run: ls -R dist
- name: Upload release assets
uses: softprops/action-gh-release@v2
with:
files: |
dist/**/ptc-*