Release #41
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: | |
jobs: | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- name: Get current version | |
id: current-version | |
run: | | |
CURRENT_VERSION=$(grep 'ProviderVersion string =' version/version.go | sed -E 's/.*"([0-9]+\.[0-9]+\.[0-9]+(-pre)?)".*/\1/') | |
echo "version=$CURRENT_VERSION" >> $GITHUB_OUTPUT | |
- name: Download Artifacts | |
uses: bitwarden/gh-actions/download-artifacts@main | |
with: | |
workflow: build.yml | |
workflow_conclusion: success | |
branch: main | |
path: artifacts | |
- name: Generate Checksum File | |
id: checksum | |
run: | | |
MODULE_NAME=$(grep "^module" go.mod | awk -F'/' '{print $NF}') | |
CHECKSUM_FILE="${MODULE_NAME}_${{ steps.current-version.outputs.version }}_SHA256SUMS" | |
shasum -a 256 artifacts/*.zip > $CHECKSUM_FILE | |
echo "module_name=$MODULE_NAME" >> $GITHUB_OUTPUT | |
echo "checksum_file=$CHECKSUM_FILE" >> $GITHUB_OUTPUT | |
ls -la | |
- name: Import GPG key | |
uses: crazy-max/ghaction-import-gpg@cb9bde2e2525e640591a934b1fd28eef1dcaf5e5 # v6.2.0 | |
with: | |
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | |
- name: Sign Checksum File | |
run: | | |
export GPG_TTY=$(tty) | |
gpg --detach-sign --local-user ${{ secrets.GPG_KEY_ID }} --output ${{ steps.checksum.outputs.checksum_file }}.sig ${{ steps.checksum.outputs.checksum_file }} | |
- name: Prepare Manifest File | |
id: manifest | |
run: | | |
MANIFEST_FILE="${{ steps.checksum.outputs.module_name}}_${{ steps.current-version.outputs.version }}_manifest.json" | |
cp terraform-registry-manifest.json $MANIFEST_FILE | |
echo "manifest_file=$MANIFEST_FILE" >> $GITHUB_OUTPUT | |
# - name: Release | |
# uses: ncipollo/release-action@cdcc88a9acf3ca41c16c37bb7d21b9ad48560d87 # v1.15.0 | |
# with: | |
# name: "${{ steps.current-version.outputs.version }}" | |
# generateReleaseNotes: true | |
# artifacts: "artifacts/*.zip, | |
# ${{ steps.manifest.outputs.manifest_file }}, | |
# ${{ steps.checksum.outputs.checksum_file }}, | |
# ${{ steps.checksum.outputs.checksum_file }}.sig" |