Skip to content

Merge branch 'awx_workflow_job_template_role' into 'main' #1

Merge branch 'awx_workflow_job_template_role' into 'main'

Merge branch 'awx_workflow_job_template_role' into 'main' #1

Workflow file for this run

name: "Terraform Provider Release"
# This GitHub action creates a release when a tag that matches the pattern
# "v*" (e.g. v0.1.0) is created.
on:
push:
branches:
- "main"
# Releases need permissions to read and write the repository contents.
# GitHub considers creating releases and uploading assets as writing contents.
permissions:
contents: "write"
jobs:
release-tag:
runs-on: "ubuntu-latest"
steps:
- name: "Checkout"
uses: "actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332" # v4.1.7
with:
fetch-depth: 0
ref: "refs/heads/main"
# Avoid persisting GITHUB_TOKEN credentials as they take priority over our service account PAT for `git push` operations
# More details: https://github.com/actions/checkout/blob/b4626ce19ce1106186ddf9bb20e706842f11a7c3/adrs/0153-checkout-v2.md#persist-credentials
persist-credentials: false
- name: "Git Push Release Tag"
run: |
export VERSION=$(cat VERSION)
echo "Publishing tag $VERSION for release."
git tag $VERSION
git push https://git:${{ secrets.GITHUB_TOKEN }}@github.com/josh-silvas/terraform-provider-awx $VERSION
goreleaser:
runs-on: "ubuntu-latest"
needs: ["release-tag"]
steps:
- uses: "actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9" # v3.5.3
with:
# Allow goreleaser to access older tag information.
fetch-depth: 0
- uses: "actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe" # v4.1.0
with:
go-version-file: "go.mod"
cache: true
- name: "Import GPG key"
uses: "crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41" # v5.3.0
id: "import_gpg"
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: "Run GoReleaser"
uses: "goreleaser/goreleaser-action@3fa32b8bb5620a2c1afe798654bbad59f9da4906" # v4.4.0
with:
args: "release --clean"
version: "v1.26.2"
env:
# GitHub sets the GITHUB_TOKEN secret automatically.
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}