Files
terraform-docs/.github/workflows/release.yaml
Khosrow Moossavi 6f4b4d8536 Bump golang to 1.17.6
Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
2022-01-06 19:03:50 -05:00

74 lines
2.2 KiB
YAML

name: release
on:
push:
tags:
- "v*.*.*"
- "!v*.*.*-*"
env:
GO_VERSION: "1.17.6"
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
jobs:
assets:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Login to Docker
uses: docker/login-action@v1
if: env.REGISTRY_USERNAME != ''
with:
registry: quay.io
username: ${{ secrets.REGISTRY_USERNAME }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
if: env.REGISTRY_USERNAME != ''
with:
version: latest
args: release --rm-dist --skip-sign
env:
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
- name: Set version output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v'
- name: Update Chocolatey package
run: ./scripts/release/update-choco.sh "${{ steps.vars.outputs.tag }}"
- name: Update Chocolatey package
uses: drud/action-cross-commit@master
with:
source-folder: scripts/release/chocolatey-package
destination-repository: https://${{ secrets.COMMITTER_USERNAME }}:${{ secrets.COMMITTER_TOKEN }}@github.com/terraform-docs/chocolatey-package
destination-folder: .
destination-branch: main
git-user: terraform-docs-bot
git-user-email: bot@terraform-docs.io
git-commit-message: "Chocolatey update for terraform-docs version v${{ steps.vars.outputs.tag }}"
excludes: README.md:LICENSE:DCO:.git:.github
homebrew:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Bump Homebrew formula version
uses: dawidd6/action-homebrew-bump-formula@v3.8.0
if: "!contains(github.ref, '-')" # skip prereleases
with:
token: ${{ secrets.COMMITTER_TOKEN }}
formula: terraform-docs