Skip to content

build: generate proper release title and description #12

build: generate proper release title and description

build: generate proper release title and description #12

Workflow file for this run

---
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ^1.25
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get dependencies
run: |
go get -v -t ./...
- name: Test
run: |
go test -v ./...
- name: Build
run: |
./build.sh build
- name: Generate changelog
id: changelog
run: |
# Get the previous tag (if any)
previous_tag=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "")
if [ -n "$previous_tag" ]; then
log=$(git log --pretty=format:"%s" "$previous_tag"..HEAD)
else
log=$(git log --pretty=format:"%s")
fi
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$log" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release (draft)
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.ref_name }}
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changelog }}
draft: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}