Skip to content

Automated Release

Automated Release #61

Workflow file for this run

# SPDX-FileCopyrightText: The terraform-provider-k8s Authors
# SPDX-License-Identifier: 0BSD
name: Automated Release
on:
schedule:
- cron: 23 6 * * MON
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
timeout-minutes: 120
permissions:
contents: write
steps:
- id: checkout
name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- id: commits
name: Count Commits
run: echo "::set-output name=count::$(git rev-list --count HEAD --since='last Monday' -- internal)"
- id: release
name: Create Release Version
if: steps.commits.outputs.count > 0
run: echo "::set-output name=version::$(date +'%Y.%-m.%-d')"
- id: tag
name: Create Release Tag
if: steps.commits.outputs.count > 0
uses: EndBug/latest-tag@latest
with:
ref: ${{ steps.release.outputs.version }}
- id: setup_go
name: Set up Go
uses: actions/setup-go@v3
if: steps.commits.outputs.count > 0
with:
go-version-file: go.mod
cache: true
- id: import_gpg
name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v5
if: steps.commits.outputs.count > 0
with:
gpg_private_key: ${{ secrets.GPG_SECRET_KEY_BASE64 }}
passphrase: ${{ secrets.GPG_SECRET_KEY_PASSWORD }}
- id: goreleaser
name: Run GoReleaser
uses: goreleaser/[email protected]
if: steps.commits.outputs.count > 0
with:
version: latest
args: release --rm-dist --timeout 120m --parallelism 1
env:
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}