mirror of
https://gitee.com/gokins/gokins.git
synced 2024-11-29 17:57:50 +08:00
Merge pull request #31 from k8scat/add-release-workflow
Add release workflow
This commit is contained in:
commit
fe4a57258e
38
.github/workflows/release.yaml
vendored
Normal file
38
.github/workflows/release.yaml
vendored
Normal 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 }}
|
Loading…
Reference in New Issue
Block a user