-
Notifications
You must be signed in to change notification settings - Fork 2
90 lines (75 loc) · 2.3 KB
/
release-tags.yml
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
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: release-tags
on:
# push:
# branches: [ "main" ]
# pull_request:
# branches: [ "main" ]
push:
tags:
- "*"
jobs:
linux-part:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: "Build Changelog"
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
with:
commitMode: true
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Install system dependencies
run: sudo apt-get install -y gcc-mingw-w64-x86-64 gcc-aarch64-linux-gnu
- name: Install dependencies
run: go mod tidy
- name: Build
run: |
bash scripts/build.sh linux amd64
bash scripts/build.sh linux arm64
bash scripts/build.sh windows amd64
- name: echo changelog
run: echo ${{steps.build_changelog.outputs.changelog}}
- name: Release
uses: softprops/action-gh-release@v1
# if: startsWith(github.ref, 'refs/tags/')
with:
body: ${{steps.build_changelog.outputs.changelog}}
fail_on_unmatched_files: true
prerelease: false
files: build/*
# - name: info
# run: echo ${{ steps.Release.outputs.url }} ${{ steps.Release.outputs.upload_url }} ${{ steps.Release.outputs.id }}
mac-part:
if: startsWith(github.ref, 'refs/tags/')
runs-on: macos-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21.x"
- name: Install dependencies
run: go mod tidy
- name: Build
run: |
bash scripts/build.sh darwin arm64
bash scripts/build.sh darwin amd64
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
overwrite: true
file_glob: true
file: build/*