chore(ci): install pkg-config in release workflow for Windows runners #23
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: | |
pull_request: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: go.mod | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Install Strawberry Perl | |
if: runner.os == 'Windows' | |
run: choco install strawberryperl -y | |
- name: Install pkg-config | |
if: runner.os == 'Windows' | |
run: choco install pkgconfiglite -y | |
- name: Add Perl bin to PATH | |
if: runner.os == 'Windows' | |
run: echo "C:\\Strawberry\\perl\\bin" >> $Env:GITHUB_PATH | |
shell: pwsh | |
- name: Install Dependencies | |
run: bash hack/install-deps.sh | |
- name: Build Binary | |
shell: bash | |
env: | |
CGO_ENABLED: 1 | |
run: | | |
go build \ | |
-ldflags "-X main.buildDate=$(date -u +'%Y-%m-%dT%H:%M:%SZ') \ | |
-X main.buildVersion=${{ github.ref_name }}" \ | |
-o nomi-cli ./cmd/cli | |
- name: Archive Binary (Windows) | |
if: runner.os == 'Windows' | |
run: | | |
powershell -Command "Compress-Archive -Path nomi-cli.exe -DestinationPath nomi-cli-windows.zip" | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: nomi-cli-${{ runner.os }} | |
path: nomi-cli-*.tar.gz | |
release: | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download Artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Generate Release Notes | |
id: notes | |
run: | | |
echo "## Release Notes" > release_notes.md | |
git log $(git describe --tags --abbrev=0)..HEAD --pretty=format:'- %s' >> release_notes.md | |
- name: Create GitHub Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: artifacts/** | |
body_path: release_notes.md | |
token: ${{ secrets.GITHUB_TOKEN }} |