Skip to content

cicd: try going back to tags #3

cicd: try going back to tags

cicd: try going back to tags #3

Workflow file for this run

name: Release
on:
push:
tags:
- v*
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: 1.21
- name: Release Version
run: echo RELEASE_VERSION=$(echo $GITHUB_REF_NAME | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+.*$') >> $GITHUB_ENV
- name: Changes Heading Up-To-Date Check
run: |
date=$(date "+%Y-%m-%d")
header=$(head -n1 Changes.md)
if [ "$header" != "$RELEASE_VERSION $date" ]; then
echo "Changes.md is out of date!"
echo "Expected header: $RELEASE_VERSION $date"
echo "Found header: $header"
exit 1
else
echo "Changes.md heading looks good."
fi
- name: Release Notes Capture
run: |
sed -n '/^[0-9]/,/^[0-9]/p' | head -n-1 | tail -n-1 > release-notes.md
echo "Release Notes Will be..."
echo "========================"
cat release-notes.md
- name: Linux 64-bit Build
env:
GOOS: linux
GOARCH: amd64
run: go build -o today-$RELEASE_VERSION-$GOOS-$GOARCH ./
- name: Apple Silicon Build
env:
GOOS: darwin
GOARCH: arm64
run: go build -o today-$RELEASE_VERSION-$GOOS-$GOARCH ./
- name: Apple Intel Build
env:
GOOS: darwin
GOARCH: amd64
run: go build -o today-$RELEASE_VERSION-$GOOS-GOARCH ./
- name: Create Release
run: gh release create "v$RELEASE_VERSION" --draft --notes-file=release-notes.md
- name: Upload Linux 64-bit Binary
run: gh release upload "v$RELEASE_VERSION" today-$RELEASE_VERSION-linux-amd64
- name: Upload Apple Silicon Binary
run: gh release upload "v$RELEASE_VERSION" today-$RELEASE_VERSION-darwin-arm64
- name: Upload Apple Intel Binary
run: gh release upload "v$RELEASE_VERSION" today-$RELEASE_VERSION-darwin-amd64
- name: Finalize Release
run: gh release edit "v$RELEASE_VERSION" --draft=false