39145e5887
release / release (push) Successful in 15s
The release step created releases with no body. Read the tag's annotation into RELEASE_NOTES.md and pass it via body_path so each release carries purpose-written notes. Fetch full history so the annotated tag object is available to the build. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
1.8 KiB
YAML
61 lines
1.8 KiB
YAML
name: release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*"
|
|
|
|
jobs:
|
|
release:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: "1.22"
|
|
cache-dependency-path: service/go.sum
|
|
|
|
- name: Vet
|
|
working-directory: service
|
|
run: go vet ./...
|
|
|
|
- name: Build static linux/amd64 binary
|
|
working-directory: service
|
|
env:
|
|
CGO_ENABLED: "0"
|
|
GOOS: linux
|
|
GOARCH: amd64
|
|
run: |
|
|
go build -trimpath -ldflags="-s -w" -o weircon-random-proxy .
|
|
ls -lh weircon-random-proxy
|
|
|
|
- name: Stage release bundle
|
|
run: |
|
|
VERSION="${{ github.ref_name }}"
|
|
STAGE="weircon-random-proxy-${VERSION}-linux-amd64"
|
|
mkdir -p "dist/${STAGE}"
|
|
cp service/weircon-random-proxy "dist/${STAGE}/"
|
|
cp -r lxc npm README.md "dist/${STAGE}/"
|
|
tar -C dist -czf "dist/${STAGE}.tar.gz" "${STAGE}"
|
|
sha256sum "dist/${STAGE}.tar.gz" "dist/${STAGE}/weircon-random-proxy" > dist/SHA256SUMS
|
|
ls -lh dist/
|
|
|
|
- name: Extract release notes from tag
|
|
run: git tag -l --format='%(contents)' "${{ github.ref_name }}" > RELEASE_NOTES.md
|
|
|
|
- name: Upload release asset
|
|
uses: https://gitea.com/actions/gitea-release-action@v1
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
server_url: ${{ github.server_url }}
|
|
tag_name: ${{ github.ref_name }}
|
|
name: ${{ github.ref_name }}
|
|
body_path: RELEASE_NOTES.md
|
|
files: |
|
|
dist/weircon-random-proxy-${{ github.ref_name }}-linux-amd64.tar.gz
|
|
dist/weircon-random-proxy-${{ github.ref_name }}-linux-amd64/weircon-random-proxy
|
|
dist/SHA256SUMS
|