Files
terraform-docs/.github/workflows/release.yaml
2020-07-14 13:11:14 -04:00

75 lines
2.1 KiB
YAML

name: release
on:
push:
tags:
- 'v*.*.*'
- '!v*.*.*-*'
jobs:
release:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Set up Go 1.14.x
uses: actions/setup-go@v1
with:
go-version: 1.14.x
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Build binaries for all OS/ARCH platforms
run: |
export PATH=$PATH:$(go env GOPATH)/bin
make gox build-all
- name: Generate Changelog
run: |
export PATH=$PATH:$(go env GOPATH)/bin
./scripts/release/release-note.sh
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
body_path: CURRENT-RELEASE-CHANGELOG.md
files: bin/terraform-docs-v*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
docker:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v1
- name: Set version output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v'
- name: Build and push Docker image
run: |
echo ${REGISTRY_PASSWORD} | docker login -u ${REGISTRY_USERNAME} --password-stdin quay.io
DOCKER_TAG=${{ steps.vars.outputs.tag }} make docker push
DOCKER_TAG=latest make push
env:
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }}
REGISTRY_PASSWORD: ${{ secrets.REGISTRY_PASSWORD }}
homebrew:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- name: Bump Homebrew formula version
uses: mislav/bump-homebrew-formula-action@v1.4
if: "!contains(github.ref, '-')" # skip prereleases
with:
formula-name: terraform-docs
env:
COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}