Skip to content

Add permissions to write #6

Add permissions to write

Add permissions to write #6

Workflow file for this run

name: ci
on:
push:
pull_request:
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
jobs:
test-and-build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Test
run: go test ./...
- name: Build
run: go build .
create-release:
needs: test-and-build
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: "1.21"
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}