Release to Puppet Forge #9
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 to Puppet Forge" | |
on: "workflow_dispatch" | |
jobs: | |
test: | |
uses: "./.github/workflows/ci.yml" | |
release: | |
runs-on: "ubuntu-latest" | |
needs: "test" | |
steps: | |
- uses: "actions/checkout@v4" | |
- name: "get version" | |
id: "get_version" | |
run: | | |
echo "version=`jq --raw-output .version metadata.json`" >> $GITHUB_OUTPUT | |
- name: "pdk build" | |
uses: "docker://puppet/pdk:3.0.0.0" | |
with: | |
args: "build" | |
- name: "gh changelog get --latest" | |
run: | | |
export GH_HOST=github.com | |
gh extension install chelnak/gh-changelog | |
gh changelog get --latest > OUTPUT.md | |
env: | |
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: "gh release create" | |
run: | | |
gh release create v${{ steps.get_version.outputs.version }} --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md | |
env: | |
GH_TOKEN: "${{ secrets.GITHUB_TOKEN }}" | |
- name: "pdk publish" | |
uses: "docker://puppet/pdk:3.0.0.0" | |
with: | |
args: "release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force" |