Files
hotp_calc/.gitea/workflows/release.yml
T
a.gritsenkoandClaude Sonnet 5 43b04b0df5
CI / test (push) Successful in 42s
Release / build-and-publish (push) Failing after 1m34s
release: use built-in Actions token for package publish
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-20 20:09:11 +03:00

37 lines
928 B
YAML

name: Release
on:
push:
tags: ['v*.*.*']
jobs:
build-and-publish:
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build
run: make dist VERSION=${GITEA_REF_NAME#v}
env:
GITEA_REF_NAME: ${{ gitea.ref_name }}
- name: Publish to package registry
env:
VERSION: ${{ gitea.ref_name }}
TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE: ${{ gitea.server_url }}/api/packages/${{ gitea.repository_owner }}/generic/hotpcalc
run: |
set -e
for f in dist/*; do
name=$(basename "$f")
echo "upload: $name"
curl -fsSL -H "Authorization: token ${TOKEN}" \
--upload-file "$f" \
"${BASE}/${VERSION#v}/${name}"
done