release v1.3.0 #36
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: release | |
run-name: release v${{ github.event.inputs.version }} | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "gh-actions version to be released (without leading v)" | |
required: true | |
type: string | |
env: | |
GOMPLATE_VERSION: "v3.8.0" | |
REGISTRY_USERNAME: ${{ secrets.REGISTRY_USERNAME }} | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
if: "!contains(github.event.head_commit.message, '[ci skip]')" | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
token: ${{ secrets.COMMITTER_TOKEN }} | |
- name: Install gomplate | |
run: | | |
sudo curl -o /usr/local/bin/gomplate -sSL https://github.com/hairyhenderson/gomplate/releases/download/${{ env.GOMPLATE_VERSION }}/gomplate_linux-amd64 | |
sudo chmod 755 /usr/local/bin/gomplate | |
- name: Get variables | |
run: | | |
release_version="${{ inputs.version }}" | |
echo "release_version=${release_version//v/}" >> "$GITHUB_ENV" | |
- name: Prepare v${{ env.release_version }} Release | |
run: | | |
./.github/scripts/prepare-release.sh ${{ env.release_version }} | |
- name: Push v${{ env.release_version }} Changes | |
uses: stefanzweifel/git-auto-commit-action@v5 | |
env: | |
GITHUB_TOKEN: ${{ secrets.COMMITTER_TOKEN }} | |
with: | |
file_pattern: "README.md action.yml" | |
commit_message: "chore: prepare release v${{ env.release_version }}" | |
commit_user_name: terraform-docs-bot | |
commit_user_email: [email protected] | |
commit_author: "terraform-docs-bot <[email protected]>" | |
commit_options: "--signoff" | |
docker: | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
- name: Get variables | |
run: | | |
release_version="${{ inputs.version }}" | |
echo "release_version=${release_version//v/}" >> "$GITHUB_ENV" | |
- 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 Docker image | |
if: env.REGISTRY_USERNAME != '' | |
run: | | |
docker build --pull --tag quay.io/terraform-docs/gh-actions:${{ env.release_version }} . | |
docker build --pull --tag quay.io/terraform-docs/gh-actions:latest . | |
docker push quay.io/terraform-docs/gh-actions:${{ env.release_version }} | |
docker push quay.io/terraform-docs/gh-actions:latest | |
update-tag: | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: main | |
fetch-depth: 0 | |
fetch-tags: true | |
token: ${{ secrets.COMMITTER_TOKEN }} | |
- name: Get variables | |
run: | | |
release_version="${{ inputs.version }}" | |
echo "release_version=${release_version//v/}" >> "$GITHUB_ENV" | |
- name: Cut v${{ env.release_version }} Release | |
run: | | |
git config --global user.name terraform-docs-bot | |
git config --global user.email [email protected] | |
git tag "v${{ env.release_version }}" | |
git push origin "v${{ env.release_version }}" | |
VERSION=$(echo ${{ env.release_version }} | cut -d. -f1) | |
git tag -f v${VERSION} | |
git push -f v${VERSION} |