-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add package workflow #491
base: develop
Are you sure you want to change the base?
Add package workflow #491
Changes from 6 commits
c673a18
1feb127
1239c96
dbeb881
417cf59
ebe77cb
93b30b8
cc09a14
ca217bc
248785a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Package and Deploy | ||
|
||
on: | ||
push: | ||
branches: | ||
- feature/package-artifact | ||
lipkau marked this conversation as resolved.
Show resolved
Hide resolved
|
||
workflow_dispatch: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is cool! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've always had it, I guess it's a force of habit. It's also how Copilot suggested it. 🤷♂️ |
||
|
||
|
||
jobs: | ||
build_package_deploy: | ||
name: Deploy Module | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Setup PowerShell module cache | ||
id: cacher | ||
uses: actions/cache@v3 | ||
with: | ||
path: "~/.local/share/powershell/Modules" | ||
key: ${{ runner.os }}-PSModules | ||
- name: Setup | ||
shell: pwsh | ||
run: | | ||
./Tools/setup.ps1 | ||
Invoke-Build -Task ShowInfo | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. consider removing this, if we don't need it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it useful and doesn't impact negatively the process. But your call. |
||
- name: Build | ||
shell: pwsh | ||
run: | | ||
Invoke-Build -Task Clean, Build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. do we need this? |
||
- name: Package | ||
shell: pwsh | ||
run: | | ||
Invoke-Build -Task Package | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can't we inline this with the previous task? Invoke-Build -Task Clean, Build, Package it's not like the tasks would benefit from the split, right? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keeping the steps separate means it's easy to see quickly where it failed and why. Not benefit to merging them together IMO. But you're call. |
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The package step is 'new', it's so we can generate the zip file for the module. I'm not sure yet if it's even worth keeping once we add the release mechanism to GitHub. But will make the changes. Good for it to fail if not found. |
||
with: | ||
name: JiraPS.zip | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/actions/upload-artifact#zip-archives The uploading of an artifact creates a maybe we should remove the zipping in |
||
path: ./Release/JiraPS.zip | ||
- name: Deploy | ||
shell: pwsh | ||
run: | | ||
# Invoke-Build -Task Deploy | ||
Write-Warning "SKIPPING: Invoke-Build -Task Deploy" | ||
if: ${{ success() }} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -194,6 +194,13 @@ task UpdateManifest GetNextVersion, { | |
if ($ModuleAlias) { | ||
BuildHelpers\Update-Metadata -Path "$env:BHBuildOutput/$env:BHProjectName/$env:BHProjectName.psd1" -PropertyName AliasesToExport -Value @($ModuleAlias.Name) | ||
} | ||
|
||
$Prerelease = '' | ||
if ("$env:BHBranchName" -notin @('master','main')) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you are checking the branch for both |
||
$Prerelease = "$env:BHBranchName".ToLower() -replace '[^a-zA-Z0-9]' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would like more documentation on this.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the quotations around the |
||
} | ||
BuildHelpers\Update-Metadata -Path "$env:BHBuildOutput/$env:BHProjectName/$env:BHProjectName.psd1" -PropertyName Prerelease -Value $Prerelease | ||
|
||
} | ||
|
||
# Synopsis: Create a ZIP file with this build | ||
mkellerman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think
Package
is needed in the "CI" part of the pipeline.We don't need to generate the package every time someone pushes a new commit to a PR.
And
Package
is also defined (currently double) in thepackage_deploy.yml
-- where I think it actually belongs in.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I was originally thinking of having every PR generate a package as well, but this is overkill.
Will cleanup before converting this Draft PR to a real PR.