Build and Release #11
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: Build and Release | |
on: | |
workflow_dispatch: # Allow manual execution | |
push: | |
tags: | |
- 'v*' # Trigger on version tags | |
jobs: | |
build-windows: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Install Dependencies | |
run: | | |
choco install make -y | |
make format | |
make test | |
- name: Build Windows Binary | |
run: | | |
make build GOGG_BINARY=gogg.exe | |
- name: Upload Windows Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gogg-windows-amd64.zip | |
path: bin/gogg.exe | |
build-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Install Dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y make | |
make format | |
make test | |
- name: Build Linux Binary | |
run: | | |
make build | |
- name: Upload Linux Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gogg-linux-amd64.zip | |
path: bin/gogg | |
build-macos: | |
runs-on: macos-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Install Dependencies | |
run: | | |
brew install make | |
make format | |
make test | |
- name: Build macOS Binary | |
run: | | |
make build-macos | |
- name: Upload macOS Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gogg-macos-universal.zip | |
path: bin/gogg | |
release: | |
runs-on: ubuntu-latest | |
needs: [ build-windows, build-linux, build-macos ] | |
steps: | |
- name: Download Windows Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: gogg-windows-amd64.zip | |
- name: Download Linux Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: gogg-linux-amd64.zip | |
- name: Download macOS Artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: gogg-macos-universal.zip | |
- name: Move Artifacts to Root Directory | |
run: | | |
mv gogg-windows-amd64.zip . | |
mv gogg-linux-amd64.zip . | |
mv gogg-macos-universal.zip . | |
- name: List Downloaded Files (Debugging) | |
run: ls -R . | |
- name: Create GitHub Release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
name: ${{ github.ref_name }} | |
tag: ${{ github.ref_name }} | |
body: | | |
Release version ${{ github.ref_name }} | |
- Builds for Windows, Linux, and macOS. | |
artifacts: | | |
gogg-windows-amd64.zip | |
gogg-linux-amd64.zip | |
gogg-macos-universal.zip | |
draft: false | |
prerelease: false | |