Add CI for binary releases.

This commit is contained in:
Pieter Hollander 2024-02-22 11:42:04 +01:00
parent 9c4de319f9
commit 0d0ae0d213
Signed by: pieter
SSH key fingerprint: SHA256:HbX+9cBXsop9SuvL+mELd29sK+7DehFfdVweFVDtMSg

View file

@ -1,28 +1,42 @@
# # https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go name: Build Golang packages
# # https://github.com/goreleaser/goreleaser-action on:
push:
branches:
- "**"
tags:
- "v*.*.*"
pull_request:
branches:
- "main"
# name: Release Go package jobs:
# on: [push] release:
if: startsWith(github.ref, 'refs/tags/')
# jobs: runs-on: ubuntu-docker
steps:
# build: - name: Check out repository code
# runs-on: ubuntu-docker uses: actions/checkout@v4
# strategy: - name: Setup go
# matrix: uses: actions/setup-go@v4
# go-version: [ '1.21' ] with:
# steps: go-version: '>=1.22'
# - uses: actions/checkout@v4 cache: false
# # - name: Setup Go ${{ matrix.go-version }} - name: release-build-linux-amd64
# # uses: actions/setup-go@v4 run: GOOS=linux GOARCH=amd64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-linux-amd64
# # with: - name: release-build-linux-arm64
# # go-version: ${{ matrix.go-version }} run: GOOS=linux GOARCH=arm64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-linux-arm64
# # # You can test your matrix by printing the current Go version - name: release-build-windows-amd64
# - name: Display Go version run: GOOS=windows GOARCH=amd64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-windows-amd64.exe
# run: go version - name: release-build-windows-arm64
# - name: Run GoReleaser run: GOOS=windows GOARCH=arm64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-windows-arm64.exe
# uses: goreleaser/goreleaser-action@master - name: release-build-darwin-amd64
# with: run: GOOS=darwin GOARCH=amd64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-darwin-amd64
# version: latest - name: release-build-darwin-arm64
# args: release --rm-dist run: GOOS=darwin GOARCH=arm64 go build -v -ldflags="-s -w -X 'main.Version=${{ github.ref_name }}'" -o bin/opendtu-logger-${{ github.ref_name }}-darwin-arm64
- name: Create release
uses: https://gitea.com/actions/release-action@main
with:
files: |-
bin/**
api_key: '${{secrets.RELEASE_TOKEN}}'