Skip to content

Commit 184375f

Browse files
committed
chore(release.yml): update GitHub Actions workflow for releasing assets
- change checkout action to v2 for improved performance - add a matrix strategy to build for multiple operating systems - utilize softprops/action-gh-release for better release management
1 parent 535cc3f commit 184375f

File tree

1 file changed

+27
-22
lines changed

1 file changed

+27
-22
lines changed

.github/workflows/release.yml

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
1+
name: Release
2+
13
on:
24
push:
35
tags:
46
- 'v*'
57

6-
name: Upload Release Assets
7-
88
jobs:
99
build:
10-
name: Upload Release Assets
1110
runs-on: ubuntu-latest
1211

12+
strategy:
13+
matrix:
14+
os: [ubuntu-latest, windows-latest, macos-latest, darwin-latest]
15+
go-version: [1.23]
16+
1317
steps:
14-
- name: Checkout code
15-
uses: actions/checkout@v3
18+
- name: Checkout code
19+
uses: actions/checkout@v2
20+
21+
- name: Set up Go
22+
uses: actions/setup-go@v2
23+
with:
24+
go-version: ${{ matrix.go-version }}
1625

17-
- name: Generate build files
18-
uses: thatisuday/[email protected]
19-
with:
20-
platforms: 'linux/amd64, linux/ppc64le, darwin/amd64, darwin/arm64, windows/amd64'
21-
package: '.'
22-
name: 'githubstats'
23-
compress: 'true'
24-
dest: 'dist'
26+
- name: Build
27+
run: |
28+
GOOS=${{ matrix.os }} GOARCH=amd64 go build -o githubstats-${{ matrix.os }} ./...
2529
26-
- name: Publish Binaries
27-
uses: svenstaro/upload-release-action@v2
28-
with:
29-
repo_token: ${{ secrets.GITHUB_TOKEN }}
30-
release_name: Release ${{ github.ref }}
31-
tag: ${{ github.ref }}
32-
file: dist/*
33-
file_glob: true
34-
overwrite: true
30+
- name: Create Release
31+
uses: softprops/action-gh-release@v1
32+
with:
33+
tag_name: ${{ github.ref }}
34+
files: |
35+
githubstats-ubuntu-latest
36+
githubstats-windows-latest.exe
37+
githubstats-macos-latest
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)