Skip to content

Commit

Permalink
Consolidate github actions.
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-silvas committed Oct 6, 2024
1 parent c904294 commit 67e2c81
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 33 deletions.
31 changes: 0 additions & 31 deletions .github/workflows/prepare.yml

This file was deleted.

24 changes: 22 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,37 @@ name: "Terraform Provider Release"
# "v*" (e.g. v0.1.0) is created.
on:
push:
tags:
- 'v*'
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:
Expand Down

0 comments on commit 67e2c81

Please sign in to comment.