Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

.github/workflows/release.yml #9

.github/workflows/release.yml

.github/workflows/release.yml #9

Workflow file for this run

on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
releases-matrix:
name: Release Go Binary
runs-on: ubuntu-latest
strategy:
matrix:
# build and publish in parallel: linux/386, linux/amd64, linux/arm64, windows/386, windows/amd64, darwin/amd64, darwin/arm64
goos: [linux, windows, darwin]
goarch: ["386", amd64, arm64]
exclude:
- goarch: "386"
goos: darwin
- goarch: arm64
goos: windows
steps:
- uses: actions/checkout@v3
- name: Set APP_VERSION env
run: echo APP_VERSION=$(basename ${GITHUB_REF}) >> ${GITHUB_ENV}
- name: Set BUILD_TIME env
run: echo BUILD_TIME=$(date --iso-8601=seconds) >> ${GITHUB_ENV}
- name: Environment Printer
uses: managedkaos/print-env@v1.0
- uses: wangyoucao577/go-release-action@v1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
goos: ${{ matrix.goos }}
goarch: ${{ matrix.goarch }}
goversion: "https://dl.google.com/go/go1.20.linux-amd64.tar.gz"
extra_files: LICENSE README.md
ldflags: -X "github.com/ahelmy/xdev/app.AppVersion=${{ env.APP_VERSION }}" -X "github.com/ahelmy/xdev/app.BuildTime=${{ env.BUILD_TIME }}" -X github.com/ahelmy/xdev/app.GitCommit=${{ github.sha }}