CHANGELOG: fake v0.2.2-pre section #1
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]+.*' | |
jobs: | |
build: | |
name: Build Binaries | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
goos: [linux, windows, darwin] | |
goarch: [amd64, arm64] | |
exclude: | |
- goos: windows | |
goarch: arm64 | |
steps: | |
- name: Checkout Code | |
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 -v ./... | |
- 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 Code | |
uses: actions/checkout@v4 | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: '**' # downloads all artifacts | |
path: build/ | |
- 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 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/* |