Skip to content

Update Go version to 1.24 in release workflow #4

Update Go version to 1.24 in release workflow

Update Go version to 1.24 in release workflow #4

Workflow file for this run

name: Build and Release
on:
push:
tags:
- 'v*'
jobs:
build:
name: Build FlutterGuard CLI
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
goos: linux
goarch: amd64
filename: flutterguard-cli
artifact_name: flutterguard-cli-linux-amd64
- os: ubuntu-latest
goos: linux
goarch: arm64
filename: flutterguard-cli
artifact_name: flutterguard-cli-linux-arm64
- os: macos-latest
goos: darwin
goarch: amd64
filename: flutterguard-cli
artifact_name: flutterguard-cli-darwin-amd64
- os: macos-latest
goos: darwin
goarch: arm64
filename: flutterguard-cli
artifact_name: flutterguard-cli-darwin-arm64
- os: windows-latest
goos: windows
goarch: amd64
filename: flutterguard-cli.exe
artifact_name: flutterguard-cli-windows-amd64.exe
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: '1.24'
- name: Build on Linux/macOS
if: matrix.os != 'windows-latest'
run: |
GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o build/${{ matrix.artifact_name }}
env:
CGO_ENABLED: 0
- name: Build on Windows
if: matrix.os == 'windows-latest'
run: |
go build -o build/${{ matrix.artifact_name }}
env:
GOOS: ${{ matrix.goos }}
GOARCH: ${{ matrix.goarch }}
CGO_ENABLED: 0
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: build/${{ matrix.artifact_name }}
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: build
- name: List artifacts
run: ls -la build/
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: |
build/flutterguard-cli-linux-amd64/flutterguard-cli-linux-amd64
build/flutterguard-cli-linux-arm64/flutterguard-cli-linux-arm64
build/flutterguard-cli-darwin-amd64/flutterguard-cli-darwin-amd64
build/flutterguard-cli-darwin-arm64/flutterguard-cli-darwin-arm64
build/flutterguard-cli-windows-amd64.exe/flutterguard-cli-windows-amd64.exe
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}