This repository was archived by the owner on May 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: auto release powered by GoReleaser. (#6)
- Loading branch information
Showing
2 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: Go | ||
on: [push] | ||
env: | ||
VERSION: 0.1 | ||
|
||
jobs: | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Set up Go 1.18 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.18 | ||
id: go | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
|
||
- name: Commit tagger | ||
uses: tvdias/github-tagger@v0.0.2 | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
tag: ${{ env.VERSION }}.${{ github.run_number }} | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: ~1.8.2 | ||
args: --snapshot --skip-publish --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Rename | ||
run: | | ||
mv dist/bilibili-live-stream_windows_arm64/bilibili-live-stream.exe bilibili-live-stream-windows_arm64.exe | ||
mv dist/bilibili-live-stream_windows_amd64_v1/bilibili-live-stream.exe bilibili-live-stream-windows_amd64.exe | ||
mv dist/bilibili-live-stream_darwin_arm64/bilibili-live-stream bilibili-live-stream-darwin_arm64 | ||
mv dist/bilibili-live-stream_darwin_amd64_v1/bilibili-live-stream bilibili-live-stream-darwin_amd64 | ||
mv dist/bilibili-live-stream_linux_arm64/bilibili-live-stream bilibili-live-stream-linux_arm64 | ||
mv dist/bilibili-live-stream_linux_amd64_v1/bilibili-live-stream bilibili-live-stream-linux_amd64 | ||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
prerelease: true | ||
generate_release_notes: true | ||
name: v${{ env.VERSION }}.${{ github.run_number }} | ||
tag_name: ${{ env.VERSION }}.${{ github.run_number }} | ||
files: | | ||
bilibili-live-stream-windows_arm64.exe | ||
bilibili-live-stream-windows_amd64.exe | ||
bilibili-live-stream-darwin_arm64 | ||
bilibili-live-stream-darwin_amd64 | ||
bilibili-live-stream-linux_arm64 | ||
bilibili-live-stream-linux_amd64 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
before: | ||
hooks: | ||
- go mod download | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- windows | ||
- darwin | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' |