Skip to content

Commit fc5a68e

Browse files
ci: run release on pushes to main via fixed publish.yaml (#472)
## Summary Make module releases run on every push to `main`, replacing the two broken release workflows with a single fixed one. Both prior workflows were broken against the current reusable `PowerShellOrg/.github/.github/workflows/powershell-release.yml@main`: - **`publish.yaml`** (push-to-`main`) startup-failed on every push to `main` — it passed an `isPrerelease` input that #468 removed. - **`release.yml`** (tag-triggered) never ran on merges and was itself broken: it passed a `module-name` input the reusable workflow does not declare, and a non-existent `PSGALLERY_API_KEY` secret. ### Approach Rename `release.yml` → `publish.yaml` and fix it. The reusable workflow is designed for the push-to-`main` model: its `check_version` job compares the manifest `ModuleVersion` against PSGallery and gates both `create_release` and `publish` on `(version_bumped || force)`. So running it on every push to `main` only actually tags/publishes when the manifest version is new — a normal merge that doesn't bump the version is a no-op. ### Changes - Trigger on `push: branches: [main]` (+ `workflow_dispatch` for manual/`force` re-runs) instead of `push: tags: ['v*']`. - Drop the `module-name: Plaster` input — not declared by the reusable workflow (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 existing `PS_GALLERY_KEY` secret. - Remove the duplicate/broken `release.yml`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5610581 commit fc5a68e

2 files changed

Lines changed: 18 additions & 50 deletions

File tree

‎.github/workflows/publish.yaml‎

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ on:
99
description: "The version to publish. Leave empty to use the version in the module manifest."
1010
required: false
1111
type: string
12-
isPrerelease:
13-
description: "Is this a prerelease version?"
12+
force:
13+
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)."
1414
required: false
1515
type: boolean
1616
default: false
@@ -19,14 +19,25 @@ on:
1919
required: false
2020
type: boolean
2121
default: false
22-
permissions:
23-
contents: write
22+
create_release:
23+
description: "If false, skip creating the GitHub release and tag."
24+
required: false
25+
type: boolean
26+
default: true
27+
publish:
28+
description: "If false, skip publishing to PowerShell Gallery."
29+
required: false
30+
type: boolean
31+
default: true
32+
2433
jobs:
2534
publish:
26-
name: Publish Module
2735
uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main
2836
with:
2937
version: ${{ inputs.version || '' }}
30-
isPrerelease: ${{ inputs.isPrerelease || false }}
38+
force: ${{ inputs.force || false }}
3139
dry_run: ${{ inputs.dry_run || false }}
32-
secrets: inherit
40+
create_release: ${{ github.event_name != 'workflow_dispatch' || inputs.create_release }}
41+
publish: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }}
42+
secrets:
43+
PS_GALLERY_KEY: ${{ secrets.PS_GALLERY_KEY }}

‎.github/workflows/release.yml‎

Lines changed: 0 additions & 43 deletions
This file was deleted.

0 commit comments

Comments
 (0)