Files
opentf/.github/workflows/release.yml
RLRabinowitz a8dc346218 Sign release artifacts (#265)
Signed-off-by: Marcin Białoń <mbialon@spacelift.io>
Signed-off-by: RLRabinowitz <rlrabinowitz2@gmail.com>
Co-authored-by: Marcin Białoń <mbialon@spacelift.io>
2023-09-12 15:05:50 +03:00

60 lines
1.4 KiB
YAML

name: release
on:
workflow_dispatch:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+*'
jobs:
release:
name: Release
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
packages: write
steps:
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Fetch tags
run: git fetch --force --tags
- name: Determine Go version
id: go
uses: ./.github/actions/go-version
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: ${{ steps.go.outputs.version }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Install cosign
uses: sigstore/cosign-installer@main
with:
cosign-release: v2.2.0
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
version: v1.20.0
args: release --clean --timeout=60m --snapshot=${{ !startsWith(github.ref, 'refs/tags/v') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}