Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Commit

Permalink
feat: auto release powered by GoReleaser. (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
GBLodb committed May 16, 2022
1 parent 2c8f92b commit 77a11bf
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/go.yml
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/[email protected]
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
30 changes: 30 additions & 0 deletions .goreleaser.yml
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:'

0 comments on commit 77a11bf

Please sign in to comment.