Skip to content

ci: add package write permission #10

ci: add package write permission

ci: add package write permission #10

Workflow file for this run

name: release
permissions:
contents: write
packages: write
on:
push:
tags:
- "*"
workflow_dispatch:
jobs:
release:
name: Package and release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: "1.22"
- uses: taiki-e/install-action@just
- name: Install GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
install-only: true
- name: Log in to registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u $ --password-stdin
- name: Publish Release
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: just build
- name: Publish
if: startsWith(github.ref, 'refs/tags/') && env.PUBLISH_TOKEN
env:
PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
PUBLISH_REPO: ${{ secrets.PUBLISH_REPO }}
PUBLISH_OWNER: ${{ secrets.PUBLISH_OWNER }}
run: |
./ci/publish.sh ./dist --repo "$PUBLISH_REPO" --owner "$PUBLISH_OWNER"