Skip to content

Commit

Permalink
Implement workflow for PowerShell gallery release (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
PalmEmanuel committed Jan 11, 2024
2 parents c934d2f + 58114e6 commit 1371440
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ on:
paths-ignore:
- CHANGELOG.md
- .github/**
tags: [v*]

env:
buildFolderName: output
Expand Down
78 changes: 72 additions & 6 deletions .github/workflows/PublishReleaseAndModule.yml
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
Expand Down Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ The format is based on and uses the types of changes according to [Keep a Change

### Added

- Implemented Sampler [#45](https://github.com/PalmEmanuel/AzAuth/issues/45)'
- Implemented Sampler for the GitHub project [#45](https://github.com/PalmEmanuel/AzAuth/issues/45)
- Bumped System.IdentityModule.Tokens.Jwt from 7.0.3 to 7.2.0

### Changed

- Improved build and test workflow to run on multiple platforms
- Updated LICENSE
- Updated LICENSE year
2 changes: 1 addition & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ BuildWorkflow:

publish:
- publish_module_to_gallery
- Publish_Release_To_GitHub
# - Publish_Release_To_GitHub
# - Publish_GitHub_Wiki_Content

####################################################
Expand Down

0 comments on commit 1371440

Please sign in to comment.