Skip to content

fix: add permission #97

fix: add permission

fix: add permission #97

Workflow file for this run

name: Go
on:
push:
paths-ignore:
- README.md
- LICENSE
jobs:
build:
permissions:
id-token: write
contents: read
attestations: write
deployments: write
name: Build
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Build
run: |
GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/sbgraph main.go
GOOS=linux GOARCH=arm64 go build -o build/linux-arm64/sbgraph main.go
GOOS=windows GOARCH=amd64 go build -o build/windows/sbgraph.exe main.go
GOOS=darwin GOARCH=amd64 go build -o build/macos-amd64/sbgraph main.go
GOOS=darwin GOARCH=arm64 go build -o build/macos-arm64/sbgraph main.go
- name: Archive
if: startsWith(github.ref, 'refs/tags/')
run: |
(cd build/linux-amd64 && tar cfvz ../sbgraph-linux-amd64.tar.gz sbgraph)
(cd build/linux-arm64 && tar cfvz ../sbgraph-linux-arm64.tar.gz sbgraph)
(cd build/windows && tar cfvz ../sbgraph-windows-amd64.tar.gz sbgraph.exe)
(cd build/macos-amd64 && tar cfvz ../sbgraph-darwin-amd64.tar.gz sbgraph)
(cd build/macos-arm64 && tar cfvz ../sbgraph-darwin-arm64.tar.gz sbgraph)
- name: Generate artifact attestations
if: startsWith(github.ref, 'refs/tags/')
uses: actions/attest-build-provenance@v1
with:
subject-path: 'build/*.tar.gz'
- name: Publish
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: build/*.tar.gz