mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 12:58:35 +07:00
81 lines
2.1 KiB
YAML
81 lines
2.1 KiB
YAML
name: prerelease
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*-*"
|
|
|
|
env:
|
|
GO_VERSION: "1.24.2"
|
|
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
|
|
|
|
jobs:
|
|
prerelease:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ env.GO_VERSION }}
|
|
|
|
- name: Run GoReleaser
|
|
uses: goreleaser/goreleaser-action@v6
|
|
if: env.REGISTRY_USERNAME != ''
|
|
with:
|
|
distribution: goreleaser
|
|
version: 1.26.2
|
|
args: release --clean --skip=publish --skip=sign
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: dist/terraform-docs-v*
|
|
draft: false
|
|
prerelease: true
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
|
|
|
|
docker:
|
|
runs-on: ubuntu-latest
|
|
if: "!contains(github.event.head_commit.message, '[ci skip]')"
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v4
|
|
with:
|
|
fetch-depth: 0
|
|
|
|
- name: Set version output
|
|
id: vars
|
|
run: echo "release_tag=${GITHUB_REF:11}" >> "$GITHUB_ENV" # tag name without leading 'v'
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3
|
|
|
|
- name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v3
|
|
|
|
- name: Login to Docker
|
|
uses: docker/login-action@v3
|
|
if: env.REGISTRY_USERNAME != ''
|
|
with:
|
|
registry: quay.io
|
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v6
|
|
with:
|
|
outputs: "type=registry,push=true"
|
|
platforms: linux/amd64,linux/arm64
|
|
push: true
|
|
tags: quay.io/${{ github.event.repository.name }}/terraform-docs:${{ steps.vars.outputs.tag }}
|
|
|
|
|