Skip to content

feat: overhaul change file format — kind, mandatory, safety, chore, K… #14

feat: overhaul change file format — kind, mandatory, safety, chore, K…

feat: overhaul change file format — kind, mandatory, safety, chore, K… #14

Workflow file for this run

on:
push:
branches: [master, alpha]
paths-ignore:
- 'CHANGELOG.md'
- '.changes/**'
name: release
concurrency:
group: release-${{ github.ref }}
cancel-in-progress: false
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 15
if: github.actor != 'github-actions[bot]'
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Rebase on top of latest remote
run: git pull --rebase --autostash origin "${GITHUB_REF_NAME}"
- name: Fetch all tags
run: git fetch --tags
- name: Run release tool
id: meta
uses: ./
with:
mode: release
notes-output: release-notes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push commit and tag
if: steps.meta.outputs.tag != ''
run: git push origin HEAD "${{ steps.meta.outputs.tag }}"
- name: Build release binaries
if: steps.meta.outputs.tag != ''
run: |
mkdir -p dist
for platform in linux/amd64 linux/arm64 darwin/amd64 darwin/arm64 windows/amd64; do
GOOS="${platform%/*}" GOARCH="${platform#*/}"
EXT=""
[ "$GOOS" = "windows" ] && EXT=".exe"
GOOS=$GOOS GOARCH=$GOARCH go build -ldflags "-s -w" -o "dist/release-tool-${GOOS}-${GOARCH}${EXT}" .
done
- name: Create GitHub release
if: steps.meta.outputs.tag != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAG: ${{ steps.meta.outputs.tag }}
PRERELEASE: ${{ steps.meta.outputs.prerelease }}
run: |
ARGS=("$TAG" --title "$TAG" --notes-file release-notes.md dist/*)
[ "$PRERELEASE" = "true" ] && ARGS+=(--prerelease)
gh release create "${ARGS[@]}"