Add go package build workflow.
All checks were successful
Build Docker image / build (push) Successful in 58s

This commit is contained in:
Pieter Hollander 2024-02-21 19:02:51 +01:00
parent bfffaa233d
commit e508e8d967
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

38
.gitea/workflows/go.yml Normal file
View file

@ -0,0 +1,38 @@
name: release
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup go
uses: https://github.com/actions/setup-go@v4
with:
go-version: '>=1.x'
- name: release-build-linux-amd64
run: GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-linux-amd64
- name: release-build-linux-arm64
run: GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-linux-arm64
- name: release-build-windows-amd64
run: GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-windows-amd64.exe
- name: release-build-windows-arm64
run: GOOS=windows GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-windows-arm64.exe
- name: release-build-darwin-amd64
run: GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-darwin-amd64
- name: release-build-darwin-arm64
run: GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/reverse-${{ github.ref_name }}-darwin-arm64
- name: Use Go Action
id: use-go-action
uses: actions/release-action@main
with:
files: |-
bin/**
api_key: '${{secrets.RELEASE_TOKEN}}'