Testing build workflow #29
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 Deploy | |
on: | |
push: | |
branches: | |
- master # Trigger workflow on pushes to the 'main' branch | |
pull_request: | |
branches: | |
- master # Optional: Run on pull requests to 'main' | |
jobs: | |
build: | |
name: Build, Compress, and Deploy | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
os: [ linux, darwin, windows ] | |
arch: [ amd64, arm64 ] | |
env: | |
GO_VERSION: '1.23' | |
CGO_ENABLED: 0 | |
steps: | |
- name: Install sudo package | |
run: apt update && apt install sudo | |
# Step 1: Checkout the code | |
- name: Checkout Code | |
uses: actions/checkout@v4 | |
- name: Install make | |
run: | | |
sudo apt update | |
sudo apt-get install -y make ca-certificates jq zip git curl file | |
# Step 2: Set up Go environment | |
- name: Set up Go ${{ env.GO_VERSION }} | |
uses: actions/setup-go@v5 | |
env: | |
ImageOS: ${{ matrix.os }}-${{ matrix.arch }}-${{ matrix.goarm }} | |
with: | |
go-version: ${{ env.GO_VERSION }} | |
# Step 3: Build the application | |
- name: Build | |
env: | |
GOOS: ${{ matrix.os }} | |
GOARCH: ${{ matrix.arch }} | |
GOARM: ${{ matrix.goarm }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: make binary | |
# Step 4: Release the package | |
- name: Release | |
env: | |
GOOS: ${{ matrix.os }} | |
GOARCH: ${{ matrix.arch }} | |
GOARM: ${{ matrix.goarm }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
make release |