Skip to content

release

release #9

Workflow file for this run

---
name: release
on:
workflow_dispatch:
inputs:
sha:
description: The sha to associated with the release
required: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ inputs.sha }} # checkout out our sha to get the version
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: go.mod
- uses: ./.github/actions/build-provider
- name: Upload artifacts
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: release-artifacts
path: dist
if-no-files-found: error
retention-days: 1
overwrite: true
test-build-artifacts:
needs: build
name: enos scenario run
uses: ./.github/workflows/run-sample.yml
secrets: inherit
with:
sample-name: dev
download: release-artifacts
release:
needs:
- build
- test-build-artifacts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
ref: ${{ inputs.sha }} # checkout out our sha to get the version
- uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version-file: go.mod
- uses: actions/download-artifact@c850b930e6ba138125429b7e5c93fc707a7f8427 # v4.1.4
with:
path: dist
name: release-artifacts
merge-multiple: true
- name: Import gpg key
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Create a Github release
env:
GITHUB_TOKEN: ${{ secrets.ELEVATED_GITHUB_TOKEN }}
run: |
gpg --list-signatures
# actions/download-artifact doesn't preserve file permissions. Reset the exec bits.
chmod 755 dist/*
go run ./tools/publish/cmd github create \
--dist ./dist \
--gpg-key-id "${{ secrets.GPG_KEY_ID }}" \
--commit "${{ inputs.sha }}" \
--version "$(cat VERSION)" \
--manifest-path terraform-registry-manifest.json