Skip to content

Commit 438243c

Browse files
committed
added workflow to build latest release
1 parent 57486fa commit 438243c

File tree

2 files changed

+59
-0
lines changed

2 files changed

+59
-0
lines changed

.github/workflows/build.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: "build"
2+
3+
on:
4+
# the 1st condition
5+
workflow_run:
6+
workflows: ["re-release"]
7+
branches: [main]
8+
types:
9+
- completed
10+
11+
jobs:
12+
build_linux:
13+
permissions:
14+
contents: write
15+
packages: write
16+
17+
name: Build Go Binary
18+
runs-on: ubuntu-latest
19+
strategy:
20+
matrix:
21+
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
22+
goos: [linux]
23+
goarch: [amd64, arm, arm64]
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: wangyoucao577/go-release-action@v1
27+
with:
28+
github_token: ${{ secrets.GITHUB_TOKEN }}
29+
goos: ${{ matrix.goos }}
30+
goarch: ${{ matrix.goarch }}
31+
release_tag: latest
32+
overwrite: true
33+
extra_files: LICENSE README.md metrics.json metrics-lua.json

.github/workflows/re-release.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "re-release"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
jobs:
9+
re-release:
10+
permissions:
11+
contents: write
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Delete
18+
uses: ame-yu/action-delete-latest-release@v2
19+
with:
20+
github_token: ${{ secrets.GITHUB_TOKEN }}
21+
22+
- name: Release
23+
uses: softprops/action-gh-release@v1
24+
with:
25+
name: latest
26+
tag_name: latest

0 commit comments

Comments
 (0)