chore(go version)!: Bump go version to 1.24 (#58) #43
This file contains hidden or 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: Go Build - Release | |
on: | |
push: | |
branches: [ main ] | |
permissions: write-all | |
jobs: | |
# Release-please for auto-updated PRs | |
release-please: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: google-github-actions/release-please-action@v3 | |
id: release-please | |
with: | |
release-type: simple # actual releasing is handled by goreleaser | |
package-name: compute-blade-agent | |
outputs: | |
release_created: ${{ steps.release-please.outputs.release_created }} | |
test: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout code | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
# Set up Go environment | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache: true | |
cache-dependency-path: "**/*.sum" | |
- name: Run tests | |
run: go test -cover -coverprofile=coverage.txt ./... | |
- name: Archive code coverage results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: "coverage.txt" | |
if-no-files-found: error | |
tinygo: | |
runs-on: ubuntu-latest | |
needs: | |
- test | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache-dependency-path: "**/*.sum" | |
cache: true | |
# Setup tinygo | |
- uses: acifani/setup-tinygo@v2 | |
with: | |
tinygo-version: '0.37.0' | |
# Build fanunit firmware | |
- name: Build FanUnit Firmware | |
run: make build-fanunit | |
- name: Archive FanUnit Firmware | |
uses: actions/upload-artifact@v4 | |
with: | |
name: fanunit.uf2 | |
path: "fanunit.uf2" | |
# Goreleaser for binary releases / GH release | |
goreleaser: | |
runs-on: ubuntu-latest | |
needs: | |
- release-please | |
- tinygo | |
if: needs.release-please.outputs.release_created | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
# Install cosign | |
- name: Install Cosign | |
uses: sigstore/cosign-installer@v3 | |
# Install GoLang | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version-file: "go.mod" | |
cache-dependency-path: "**/*.sum" | |
cache: true | |
# Setup docker buildx | |
- name: Set up QEMU | |
uses: docker/setup-qemu-action@v3 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
# Download FanUnit Firmware | |
- name: Download fanunit firmware | |
uses: actions/download-artifact@v4 | |
with: | |
pattern: fanunit.uf2 | |
# Run goreleaser | |
- name: Run GoReleaser | |
uses: goreleaser/goreleaser-action@v5 | |
with: | |
version: latest | |
args: release --clean | |
env: | |
COSIGN_YES: "true" | |
KO_DOCKER_REPO: ghcr.io/${{ github.repository }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |