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
# This workflow will build a golang project | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | |
name: Release Build | |
on: | |
push: | |
branches: [ "master" ] | |
tags: | |
- '*.*.*' | |
pull_request: | |
branches: [ "master" ] | |
tags: | |
- '*.*.*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
# Include amd64 on all platforms. | |
goos: [ windows, linux ] | |
goarch: [ amd64, 386 ] | |
goamd64: [ v1 ] | |
exclude: | |
# Exclude i386 on darwin and dragonfly. | |
- goarch: 386 | |
goos: dragonfly | |
include: | |
# END Linux ARM 5 6 7 | |
# BEGIN Android ARM 8 | |
- goos: android | |
goarch: arm64 | |
# END Android ARM 8 | |
runs-on: ubuntu-latest | |
env: | |
GOOS: ${{ matrix.goos }} | |
GOARCH: ${{ matrix.goarch }} | |
GOARM: ${{ matrix.goarm }} | |
GOAMD64: ${{ matrix.goamd64 }} | |
CGO_ENABLED: 0 | |
BUILD_NAME: AutoInstall-${{ matrix.goos }}-${{ matrix.goarch }}-${{ matrix.goarm }}${{ matrix.goamd64 }}${{ matrix.goos == 'windows' && '.exe' || '' }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ^1.20 | |
check-latest: true | |
- name: Build | |
run: go build -o dist/${{ env.BUILD_NAME }} app.go && ls dist | |
- name: Get version | |
id: get_version | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | |
Publish: | |
needs: [ build ] | |
runs-on: ubuntu-latest | |
steps: | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: dist/ | |
draft: true | |
fail_on_unmatched_files: true |