-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (45 loc) · 1.67 KB
/
Copy pathrelease.yml
File metadata and controls
52 lines (45 loc) · 1.67 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
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
name: Create Release
env:
RELNAME: mono_personal_tgbot
GOARCH: amd64
jobs:
build:
name: Create Release
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v3
with:
go-version: 1.21.x
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/go/pkg/mod
~/.cache/go-build
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.OS }}-go-${{ env.cache-name }}-
${{ runner.OS }}-go-
${{ runner.OS }}-
- name: Build artifacts
run: |
CGO_ENABLED=0 GOOS=linux GOARCH=${GOARCH} go build -ldflags "-s -w" -o ./release/${RELNAME}-linux-${GOARCH} *.go
CGO_ENABLED=0 GOOS=darwin GOARCH=${GOARCH} go build -ldflags "-s -w" -o ./release/${RELNAME}-darwin-${GOARCH} *.go
CGO_ENABLED=0 GOOS=windows GOARCH=${GOARCH} go build -ldflags "-s -w" -o ./release/${RELNAME}-windows-${GOARCH}.exe *.go
zip --junk-paths ./release/${RELNAME}-linux-${GOARCH}.zip ./release/${RELNAME}-linux-${GOARCH}
zip --junk-paths ./release/${RELNAME}-darwin-${GOARCH}.zip ./release/${RELNAME}-darwin-${GOARCH}
zip --junk-paths ./release/${RELNAME}-windows-${GOARCH}.zip ./release/${RELNAME}-windows-${GOARCH}.exe
- name: Release
uses: docker://antonyurchenko/git-release:latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ALLOW_EMPTY_CHANGELOG: true
DRAFT_RELEASE: true
CHANGELOG_FILE: none
with:
args: release/*.zip