Module Release #12
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
# This is a generic workflow for releasing a Puppet module. | |
# It requires that the caller sets `secrets: inherit` to ensure | |
# that secrets are visible from steps in this workflow. | |
name: "Module Release" | |
on: | |
workflow_dispatch: | |
jobs: | |
release: | |
name: "Release" | |
runs-on: "ubuntu-latest" | |
steps: | |
- name: "Checkout" | |
uses: "actions/checkout@v4" | |
with: | |
ref: "${{ github.ref }}" | |
clean: true | |
fetch-depth: 0 | |
- name: "Get version" | |
id: "get_version" | |
run: | | |
version=$(jq --raw-output '.version | gsub("[^0-9.]"; "")' metadata.json) | |
if [ -z "$version" ]; then | |
echo "Version is empty. Exiting workflow." | |
failure "Failed to retrieve version from metadata.json" | |
else | |
echo "version=$version" >> $GITHUB_OUTPUT | |
fi | |
- name: "print version" | |
run: | | |
echo ${{ steps.get_version.outputs.version }} | |