CHANGELOG: prep for v0.5.0 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.*' | |
env: | |
go-modules: ./... ./cm/... | |
jobs: | |
build: | |
name: Build binaries | |
permissions: | |
contents: write | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64] | |
exclude: | |
- goos: windows | |
goarch: arm64 | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Run Go tests | |
run: go test ${{ env.go-modules }} | |
- name: Build binary | |
run: | | |
mkdir -p build | |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o wit-bindgen-go ./cmd/wit-bindgen-go | |
tar -czvf build/wit-bindgen-go-${{ matrix.goos }}-${{ matrix.goarch }}.tgz wit-bindgen-go | |
rm wit-bindgen-go | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: wit-bindgen-go_${{ matrix.goos }}_${{ matrix.goarch }} | |
path: build/wit-bindgen-go-${{ matrix.goos }}-${{ matrix.goarch }}.tgz | |
retention-days: 1 | |
release: | |
name: Create GitHub release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: build/ | |
merge-multiple: true # all artifacts are downloaded to this directory | |
- name: Extract release notes | |
run: | | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
cd $GITHUB_WORKSPACE | |
./scripts/extract-changelog.sh $TAG_NAME > RELEASE_NOTES.md | |
cat RELEASE_NOTES.md | |
- name: Create release | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
ls -R build/ | |
TAG_NAME=${GITHUB_REF#refs/tags/} | |
if [[ "$TAG_NAME" =~ .+-pre.* ]]; then | |
PRERELEASE_ARGS="--prerelease --latest=false" | |
else | |
PRERELEASE_ARGS="" | |
fi | |
gh release create "${{ github.ref_name }}" \ | |
--notes-file RELEASE_NOTES.md \ | |
--title "${{ github.ref_name }}" \ | |
$PRERELEASE_ARGS \ | |
build/* |