release #14
Workflow file for this run
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 | |
on: | |
workflow_dispatch: | |
inputs: | |
sha: | |
description: The sha to associated with the release | |
required: true | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
outputs: | |
linux-amd64-artifact: ${{ steps.outputs.outputs.linux-amd64-artifact }} | |
strategy: | |
fail-fast: true | |
matrix: | |
arch: | |
- amd64 | |
- arm64 | |
os: | |
- darwin | |
- linux | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ inputs.sha }} # checkout out our sha to get the version | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version-file: go.mod | |
- id: build | |
uses: ./.github/actions/build-provider | |
with: | |
target: ${{matrix.os}}/${{ matrix.arch }} | |
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4 | |
with: | |
name: ${{ steps.build.outputs.name }} | |
path: dist/${{ steps.build.outputs.name }} | |
if-no-files-found: error | |
retention-days: 1 | |
- id: outputs | |
run: | | |
{ | |
echo "linux-amd64-artifact=terraform-provider-enos_$(cat VERSION)_linux_amd64" | |
} | tee -a "$GITHUB_OUTPUT" | |
test-build-artifacts: | |
needs: build | |
name: enos scenario run | |
uses: ./.github/workflows/run-sample.yml | |
secrets: inherit | |
with: | |
sample-name: dev | |
download: ${{ needs.build.outputs.linux-amd64-artifact }} | |
release: | |
needs: | |
- build | |
- test-build-artifacts | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
ref: ${{ inputs.sha }} # checkout out our sha to get the version | |
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 | |
with: | |
go-version-file: go.mod | |
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8 | |
with: | |
path: dist | |
pattern: terraform-provider-enos_* | |
merge-multiple: true | |
- run: | | |
ls -al ./dist | |
chmod +x ./dist/* | |
- 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 |