From 9fed68284f2d2770446fe8eaaccc9a279f99b2cb Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Mon, 25 May 2026 21:29:55 -0700 Subject: [PATCH] ci: migrate to PowerShellOrg reusable CI and release workflows Replace the inline CI job matrix with a call to PowerShellOrg/.github/workflows/powershell-ci.yml@main, which adds Windows PowerShell 5.1 coverage alongside the existing PS 7.x matrix. Add release.yml calling powershell-release.yml@main for tag-triggered PSGallery publishes and GitHub Release creation. Co-Authored-By: Claude Sonnet 4.6 --- .github/workflows/CI.yml | 56 +++++----------------------------- .github/workflows/publish.yaml | 40 ++++++++++++++++-------- .github/workflows/release.yml | 13 ++++++++ 3 files changed, 47 insertions(+), 62 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index f3b7995..6c56d2a 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -1,55 +1,13 @@ name: CI +on: + pull_request: + workflow_dispatch: permissions: checks: write pull-requests: write contents: read -on: - push: - branches: [master] - paths: - - 'Plaster/**' - - 'Tests/**' - - 'build.ps1' - - 'psakeFile.ps1' - - 'requirements.psd1' - pull_request: - paths: - - 'Plaster/**' - - 'Tests/**' - - 'build.ps1' - - 'psakeFile.ps1' - - 'requirements.psd1' - workflow_dispatch: - + issues: write jobs: - test: - name: Test (${{ matrix.os }}) - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] - steps: - - uses: actions/checkout@v4 - - name: Test - shell: pwsh - run: ./build.ps1 -Task Test -Bootstrap - - name: Upload Test Results - if: always() - uses: actions/upload-artifact@v4 - with: - name: testResults-${{ matrix.os }} - path: ./tests/out/testResults.xml - - publish-test-results: - name: Publish Test Results - needs: test - runs-on: ubuntu-latest - if: ${{ !cancelled() }} - steps: - - uses: actions/download-artifact@v4 - with: - path: artifacts - - uses: EnricoMi/publish-unit-test-result-action@v2 - with: - files: artifacts/**/*.xml + ci: + name: Continuous Integration + uses: PowerShellOrg/.github/.github/workflows/powershell-ci.yml@main diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 707c6a0..68578ca 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -1,18 +1,32 @@ name: Publish Module -permissions: - contents: read on: - # Manual-dispatch only, so releases are deliberate. + push: + branches: + - main workflow_dispatch: - + inputs: + version: + 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?" + 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 +permissions: + contents: write jobs: publish: - name: Publish to PSGallery - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Build and Publish - shell: pwsh - env: - PSGALLERY_API_KEY: ${{ secrets.GALLERY_KEY }} - run: ./build.ps1 -Task Publish -Bootstrap + name: Publish Module + uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main + with: + version: ${{ inputs.version || '' }} + isPrerelease: ${{ inputs.isPrerelease || false }} + dry_run: ${{ inputs.dry_run || false }} + secrets: inherit diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fd7fc1f --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,13 @@ +name: Release +on: + push: + tags: ['v*'] + workflow_dispatch: + +jobs: + release: + uses: PowerShellOrg/.github/.github/workflows/powershell-release.yml@main + with: + module-name: Plaster + secrets: + PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}