Skip to content

Commit

Permalink
Update release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ffalor committed Apr 16, 2024
1 parent 6e5bf9a commit f98430e
Showing 1 changed file with 43 additions and 4 deletions.
47 changes: 43 additions & 4 deletions .github/workflows/release.yml
@@ -1,9 +1,48 @@
name: "Publish module"
name: "Module Release"

on:
workflow_dispatch:
workflow_call:

jobs:
release:
uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@a18620f889f9b80be693ceb62fed9067de370c94"
secrets: "inherit"
name: "Release"
runs-on: "ubuntu-latest"
if: github.repository_owner == 'CrowdStrike'

steps:

- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: "${{ github.ref }}"
clean: true
fetch-depth: 0

- 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: "Generate release notes"
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: "Create release"
run: |
gh release create v${{ steps.get_version.outputs.version }} --title v${{ steps.get_version.outputs.version }} -F OUTPUT.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Publish module"
uses: "docker://puppet/pdk:3.0.0.0"
with:
args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force'

0 comments on commit f98430e

Please sign in to comment.