-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement workflow for PowerShell gallery release (#51)
- Loading branch information
Showing
4 changed files
with
75 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,6 @@ on: | |
paths-ignore: | ||
- CHANGELOG.md | ||
- .github/** | ||
tags: [v*] | ||
|
||
env: | ||
buildFolderName: output | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,51 @@ | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
name: PublishReleaseAndModule | ||
on: | ||
push: | ||
tags: [v*] | ||
|
||
jobs: | ||
release: | ||
env: | ||
buildFolderName: output | ||
buildArtifactName: output | ||
testResultFolderName: testResults | ||
|
||
jobs: | ||
build: | ||
name: Build Module | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: 'Build and Package Module' | ||
uses: ./.github/actions/build | ||
|
||
test: | ||
name: Test Module | ||
strategy: | ||
matrix: | ||
os: [windows-latest, ubuntu-latest, macos-latest] | ||
|
||
needs: | ||
- build | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: 'Test Module' | ||
uses: ./.github/actions/test | ||
with: | ||
os: ${{ matrix.os }} | ||
|
||
release-github: | ||
name: Publish Release to GitHub | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
@@ -68,4 +106,32 @@ jobs: | |
uses: juliangruber/[email protected] | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
number: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
number: ${{ steps.create-pull-request.outputs.pull-request-number }} | ||
|
||
release-psgallery: | ||
name: Publish to PowerShell Gallery | ||
runs-on: ubuntu-latest | ||
needs: | ||
- build | ||
- test | ||
env: | ||
GalleryApiToken: ${{ secrets.PSGALLERY_KEY }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
fetch-depth: 0 | ||
|
||
- name: Download Build Artifact | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ env.buildArtifactName }} | ||
path: ${{ env.buildFolderName }} | ||
|
||
- name: Publish Release | ||
shell: pwsh | ||
run: Import-Module ./output/RequiredModules/PowerShellForGitHub; ./build.ps1 -tasks publish | ||
env: | ||
GitHubToken: ${{ secrets.GITHUB_TOKEN }} | ||
GalleryApiToken: ${{ secrets.PSGALLERY_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters