Some checks failed
Go Build Multi-Platform / build (arm64, darwin) (push) Failing after 1m28s
Go Build Multi-Platform / build (arm, linux) (push) Failing after 1m30s
Go Test Multi-Platform / Test (ubuntu-latest, amd64) (push) Successful in 1m33s
Go Build Multi-Platform / build (amd64, freebsd) (push) Failing after 53s
Go Test Multi-Platform / Test (ubuntu-latest, arm64) (push) Successful in 57s
Go Build Multi-Platform / build (amd64, windows) (push) Failing after 1m30s
Go Build Multi-Platform / build (arm64, windows) (push) Failing after 40s
Go Revive Lint / lint (push) Successful in 1m12s
Run Gosec / tests (push) Successful in 1m29s
Go Build Multi-Platform / Create Release (push) Has been cancelled
Go Build Multi-Platform / build (amd64, darwin) (push) Has been cancelled
Go Build Multi-Platform / build (arm64, freebsd) (push) Has been cancelled
Go Build Multi-Platform / build (amd64, linux) (push) Has been cancelled
Go Build Multi-Platform / build (arm, freebsd) (push) Has been cancelled
Go Build Multi-Platform / build (arm, windows) (push) Has been cancelled
Go Build Multi-Platform / build (arm64, linux) (push) Has been cancelled
105 lines
3.0 KiB
YAML
105 lines
3.0 KiB
YAML
name: Go Build Multi-Platform
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "master" ]
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
branches: [ "main", "master" ]
|
|
|
|
jobs:
|
|
build:
|
|
permissions:
|
|
contents: write
|
|
strategy:
|
|
matrix:
|
|
goos: [linux, windows, darwin, freebsd]
|
|
goarch: [amd64, arm64, arm]
|
|
exclude:
|
|
- goos: darwin
|
|
goarch: arm
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
outputs:
|
|
build_complete: ${{ steps.build_step.outcome == 'success' }}
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: https://git.quad4.io/actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
|
|
- name: Set up Go
|
|
uses: https://git.quad4.io/actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
|
|
with:
|
|
go-version: '1.25'
|
|
|
|
- name: Build
|
|
id: build_step
|
|
env:
|
|
GOOS: ${{ matrix.goos }}
|
|
GOARCH: ${{ matrix.goarch }}
|
|
GOARM: ${{ matrix.goarch == 'arm' && '6' || '' }}
|
|
run: |
|
|
output_name="reticulum-go-${GOOS}-${GOARCH}"
|
|
if [ "$GOOS" = "windows" ]; then
|
|
output_name+=".exe"
|
|
fi
|
|
go build -v -ldflags="-s -w" -o "${output_name}" ./cmd/reticulum-go
|
|
echo "Built: ${output_name}"
|
|
|
|
- name: Calculate SHA256 Checksum
|
|
run: |
|
|
output_name="reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}"
|
|
if [ "${{ matrix.goos }}" = "windows" ]; then
|
|
output_name+=".exe"
|
|
fi
|
|
sha256sum "${output_name}" > "${output_name}.sha256"
|
|
echo "Calculated SHA256 for ${output_name}"
|
|
|
|
- name: Generate SBOM
|
|
uses: https://git.quad4.io/actions/gh-gomod-generate-sbom@efc74245d6802c8cefd925620515442756c70d8f # v2
|
|
with:
|
|
version: v1
|
|
args: mod -licenses -json -output bom.json
|
|
|
|
- name: Generate SPDX SBOM with Trivy
|
|
uses: https://git.quad4.io/actions/trivy-action@22438a435773de8c97dc0958cc0b823c45b064ac
|
|
with:
|
|
scan-type: 'fs'
|
|
format: 'spdx-json'
|
|
output: 'dependency-results.sbom.json'
|
|
scan-ref: '.'
|
|
|
|
- name: Upload Artifact
|
|
uses: https://git.quad4.io/actions/upload-artifact@ff15f0306b3f739f7b6fd43fb5d26cd321bd4de5
|
|
with:
|
|
name: reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}
|
|
path: |
|
|
reticulum-go-${{ matrix.goos }}-${{ matrix.goarch }}*
|
|
bom.json
|
|
dependency-results.sbom.json
|
|
|
|
release:
|
|
name: Create Release
|
|
runs-on: ubuntu-latest
|
|
needs: build
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- name: Download All Build Artifacts
|
|
uses: https://git.quad4.io/actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a
|
|
with:
|
|
path: ./release-assets
|
|
|
|
- name: List downloaded files (for debugging)
|
|
run: ls -R ./release-assets
|
|
|
|
- name: Create Gitea Release
|
|
uses: https://git.quad4.io/actions/gitea-release-action@4875285c0950474efb7ca2df55233c51333eeb74
|
|
with:
|
|
files: ./release-assets/*/*
|