Added goreleaser and release workflow
Some checks failed
Build and Release / release (push) Failing after 27s

This commit is contained in:
Leon Mika 2025-06-01 09:44:16 +10:00
parent 314e519446
commit 67a576f786
2 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,26 @@
name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: docker
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.24'
- name: Install Goreleaser
run: |
curl -sL https://git.io/goreleaser | bash
- name: Run Goreleaser
env:
GORELEASER_CURRENT_TAG: ${{ github.ref_name }}
FORGEJO_USERNAME: ${{ secrets.FORGEJO_PACKAGE_PUBLISH_USERNAME }}
FORGEJO_TOKEN: ${{ secrets.FORGEJO_PACKAGE_PUBLISH_TOKEN }}
run: |
./bin/goreleaser release --clean --skip-validate

25
.goreleaser.yaml Normal file
View file

@ -0,0 +1,25 @@
project_name: send2gokapi
builds:
- main: .
goos:
- linux
- darwin
goarch:
- amd64
- arm64
archives:
- format: zip
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
release:
disable: true # We won't create GitHub/Gitea releases directly
blobs:
- provider: generic
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.tar.gz"
path: dist/*
url_template: https://lmika.dev/api/packages/cmd/generic/{{ .ProjectName }}/{{ .Version }}/{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.tar.gz
username: "${FORGEJO_USERNAME}"
password: "${FORGEJO_TOKEN}"