Skip to content

Commit facec71

Browse files
Simplify CI/publish workflows to mirror psake (#450)
## Summary - Replace `PesterReports.yml` with a minimal `CI.yml` that delegates dependency install to `build.ps1 -Bootstrap`, dropping the `PSDepend` + `psmodulecache` dance and the deprecated `::set-output` syntax - Simplify `publish.yaml` to rely on `-Bootstrap` instead of the drift-prone hardcoded module list in `JustinGrote/ModuleFast-action` - Kept publish as `workflow_dispatch`-only so releases remain deliberate Both workflows now mirror [psake's approach](https://github.com/psake/psake/tree/main/.github/workflows): let `build.ps1` + `requirements.psd1` be the single source of truth for dependencies. ## Test plan - [ ] CI workflow runs green on Ubuntu, Windows, macOS for this PR - [ ] Test-result check appears on the PR via `EnricoMi/publish-unit-test-result-action` - [ ] Manually dispatch `Publish Module` from a throwaway branch (or after merge) to confirm it still pushes to PSGallery 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d2739ac commit facec71

File tree

3 files changed

+66
-88
lines changed

3 files changed

+66
-88
lines changed

.github/workflows/CI.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CI
2+
permissions:
3+
checks: write
4+
pull-requests: write
5+
contents: read
6+
on:
7+
push:
8+
branches: [master]
9+
paths:
10+
- 'Plaster/**'
11+
- 'Tests/**'
12+
- 'build.ps1'
13+
- 'psakeFile.ps1'
14+
- 'requirements.psd1'
15+
pull_request:
16+
paths:
17+
- 'Plaster/**'
18+
- 'Tests/**'
19+
- 'build.ps1'
20+
- 'psakeFile.ps1'
21+
- 'requirements.psd1'
22+
workflow_dispatch:
23+
24+
jobs:
25+
test:
26+
name: Test (${{ matrix.os }})
27+
runs-on: ${{ matrix.os }}
28+
strategy:
29+
fail-fast: false
30+
matrix:
31+
os: [ubuntu-latest, windows-latest, macOS-latest]
32+
steps:
33+
- uses: actions/checkout@v4
34+
- name: Test
35+
shell: pwsh
36+
run: ./build.ps1 -Task Test -Bootstrap
37+
- name: Upload Test Results
38+
if: always()
39+
uses: actions/upload-artifact@v4
40+
with:
41+
name: testResults-${{ matrix.os }}
42+
path: ./tests/out/testResults.xml
43+
44+
publish-test-results:
45+
name: Publish Test Results
46+
needs: test
47+
runs-on: ubuntu-latest
48+
if: ${{ !cancelled() }}
49+
steps:
50+
- uses: actions/download-artifact@v4
51+
with:
52+
path: artifacts
53+
- uses: EnricoMi/publish-unit-test-result-action@v2
54+
with:
55+
files: artifacts/**/*.xml

.github/workflows/PesterReports.yml

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

.github/workflows/publish.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,18 @@
11
name: Publish Module
2+
permissions:
3+
contents: read
24
on:
3-
# Only on workflow dispatch, so that we can control when to publish.
5+
# Manual-dispatch only, so releases are deliberate.
46
workflow_dispatch:
7+
58
jobs:
6-
build:
7-
runs-on: windows-latest
9+
publish:
10+
name: Publish to PSGallery
11+
runs-on: ubuntu-latest
812
steps:
9-
- uses: actions/checkout@v2
10-
- name: ⚡ ModuleFast with Specification
11-
uses: JustinGrote/ModuleFast-action@v0.0.1
12-
with:
13-
specification: |
14-
BuildHelpers
15-
PowerShellBuild
16-
psake
17-
PSScriptAnalyzer
18-
platyPS
19-
- name: Build and publish
13+
- uses: actions/checkout@v4
14+
- name: Build and Publish
15+
shell: pwsh
2016
env:
2117
PSGALLERY_API_KEY: ${{ secrets.GALLERY_KEY }}
22-
shell: pwsh
23-
run: |
24-
./build.ps1 -Task Publish -Bootstrap
18+
run: ./build.ps1 -Task Publish -Bootstrap

0 commit comments

Comments
 (0)