-
Notifications
You must be signed in to change notification settings - Fork 1
88 lines (78 loc) · 2.02 KB
/
Copy pathrelease.yml
File metadata and controls
88 lines (78 loc) · 2.02 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build Binaries
runs-on: ubuntu-latest
strategy:
matrix:
include:
- os: windows
arch: amd64
- os: windows
arch: arm64
- os: linux
arch: amd64
- os: linux
arch: arm64
- os: darwin
arch: amd64
- os: darwin
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.23'
- name: Build Binary
env:
GOOS: ${{ matrix.os }}
GOARCH: ${{ matrix.arch }}
run: |
BINARY_NAME=LogCutter
if [ "${{ matrix.os }}" = "windows" ]; then
BINARY_NAME="${BINARY_NAME}.exe"
fi
go build -v -o "$BINARY_NAME" main.go
- name: Package Assets
shell: bash
run: |
ASSET_NAME="LogCutter-${{ matrix.os }}-${{ matrix.arch }}"
if [ "${{ matrix.os }}" = "windows" ]; then
zip "${ASSET_NAME}.zip" LogCutter.exe
else
tar -czvf "${ASSET_NAME}.tar.gz" LogCutter
fi
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: binaries-${{ matrix.os }}-${{ matrix.arch }}
path: LogCutter-*.*
retention-days: 1
release:
name: Create Consolidated Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: ./assets
pattern: binaries-*
merge-multiple: true
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: ./assets/*
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: false