gh fix #2
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
# https://docs.github.com/en/actions/learn-github-actions/contexts | |
name: release | |
permissions: | |
contents: write | |
on: | |
push: | |
branches: [ "main" ] | |
jobs: | |
build-push: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: version | |
run: | | |
VERSION=$( date '+%y%m%d.%H%M.0' ) | |
echo "VERSION:$VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: '^1.21.0' | |
- name: go build | |
run: GOOS=linux GOARCH=amd64 go build -o hs.linux.amd64 -trimpath -ldflags '-X main.Version='$VERSION hs.go | |
- name: gzip | |
run: gzip hs.linux.amd64 | |
- run: ls -l -a | |
- name: gh release | |
shell: bash | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: gh release create $VERSION hs.linux.amd64.gz | |