CI: use gh env var to detect if running on tag #6
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- 'v*.*.*' | |
jobs: | |
release: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Set up Go 1.21 | |
uses: actions/setup-go@v3 | |
with: | |
go-version: 1.21 | |
check-latest: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cross build | |
run: | | |
GOOS=linux GOARCH=386 make -e buildx | |
GOOS=linux GOARCH=amd64 make -e buildx | |
GOOS=linux GOARCH=arm GOARM=5 make -e buildx | |
GOOS=linux GOARCH=arm GOARM=6 make -e buildx | |
GOOS=linux GOARCH=arm GOARM=7 make -e buildx | |
GOOS=linux GOARCH=arm64 make -e buildx | |
GOOS=darwin GOARCH=amd64 make -e buildx | |
GOOS=darwin GOARCH=arm64 make -e buildx | |
GOOS=freebsd GOARCH=amd64 make -e buildx | |
GOOS=openbsd GOARCH=amd64 make -e buildx | |
GOOS=netbsd GOARCH=amd64 make -e buildx | |
- name: Create Release | |
uses: actions/[email protected] | |
id: create_release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ github.ref }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Assets | |
uses: glentiki/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
assets_path: ./build |