Merge pull request #31 from k8scat/add-release-workflow

Add release workflow
This commit is contained in:
Linsk Ruis 2021-04-13 10:00:48 +08:00 committed by GitHub
commit fe4a57258e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

38
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,38 @@
name: Release
on:
push:
tags:
- "v*"
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ^1.14
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Build
run: |
go mod download
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o gokins-linux-amd64 main.go
CGO_ENABLED=0 GOOS=darwin GOARCH=amd64 go build -o gokins-darwin-amd64 main.go
- name: Get version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Create Release
run: |
hub release create -m "Gokins ${{ steps.get_version.outputs.VERSION }}" \
-a gokins-linux-amd64 \
-a gokins-darwin-amd64 \
${{ steps.get_version.outputs.VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}