From 967ad5f2441683eae5da82cb1f5106d7d6ff5341 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Thu, 18 Jun 2026 17:43:23 -0700 Subject: [PATCH] ci: run release on pushes to main via fixed publish.yaml Rename release.yml to publish.yaml and fix it so releases run on every push to main (the previous publish.yaml startup-failed on each main push, and the tag-triggered release.yml never ran and was itself broken). The reusable PowerShellOrg/.github powershell-release.yml@main is built for this model: its check_version job compares the manifest version against PSGallery and gates both create_release and publish on (version_bumped || force), so pushing to main only publishes when the manifest version is actually new. Fixes applied to the call: - Trigger on push to main instead of tags ['v*']. - Drop the module-name input, which the reusable workflow does not declare (it derives the module name itself); passing it caused a startup failure. - Pass the secret as PS_GALLERY_KEY (the reusable's required secret name) sourced from the repo's PS_GALLERY_KEY secret. release.yml previously passed a non-existent PSGALLERY_API_KEY. Co-Authored-By: Claude Opus 4.8 --- .github/workflows/publish.yaml | 25 ++++++++++++++------ .github/workflows/release.yml | 43 ---------------------------------- 2 files changed, 18 insertions(+), 50 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 68578ca..cc530e8 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -9,8 +9,8 @@ on: description: "The version to publish. Leave empty to use the version in the module manifest." required: false type: string - isPrerelease: - description: "Is this a prerelease version?" + force: + description: "If true, bypass the PSGallery version existence check. Use when re-triggering a failed publish job (pattern: force=true, create_release=false, publish=true)." required: false type: boolean default: false @@ -19,14 +19,25 @@ on: required: false type: boolean default: false -permissions: - contents: write + create_release: + description: "If false, skip creating the GitHub release and tag." + required: false + type: boolean + default: true + publish: + description: "If false, skip publishing to PowerShell Gallery." + required: false + type: boolean + default: true + jobs: publish: - name: Publish Module uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main with: version: ${{ inputs.version || '' }} - isPrerelease: ${{ inputs.isPrerelease || false }} + force: ${{ inputs.force || false }} dry_run: ${{ inputs.dry_run || false }} - secrets: inherit + create_release: ${{ github.event_name != 'workflow_dispatch' || inputs.create_release }} + publish: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }} + secrets: + PS_GALLERY_KEY: ${{ secrets.PS_GALLERY_KEY }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 43b59cc..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Release -on: - push: - tags: ['v*'] - workflow_dispatch: - inputs: - version: - description: "The version to publish. Leave empty to use the version in the module manifest." - required: false - type: string - force: - description: "If true, bypass the PSGallery version existence check. Use when re-triggering a failed publish job (pattern: force=true, create_release=false, publish=true)." - required: false - type: boolean - default: false - dry_run: - description: "If true, skip actual publishing and just validate the workflow logic." - required: false - type: boolean - default: false - create_release: - description: "If false, skip creating the GitHub release and tag." - required: false - type: boolean - default: true - publish: - description: "If false, skip publishing to PowerShell Gallery." - required: false - type: boolean - default: true - -jobs: - release: - uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main - with: - module-name: Plaster - version: ${{ inputs.version || '' }} - force: ${{ inputs.force || false }} - dry_run: ${{ inputs.dry_run || false }} - create_release: ${{ github.event_name != 'workflow_dispatch' || inputs.create_release }} - publish: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }} - secrets: - PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}