-
Notifications
You must be signed in to change notification settings - Fork 3
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
SA-3610 GHA Migration #64
Merged
Merged
Changes from 103 commits
Commits
Show all changes
104 commits
Select commit
Hold shift + click to select a range
21c3f8f
workflow files
gweinjc 5e0c540
publish release [skip ci]
jworkmanjc 137d91c
add new v1 rule and ignore not found find & replace in V2
jworkmanjc 3d75ef2
Update jcapi-powershell-ci.yml
gweinjc f2d3dc7
remove build and replace with testing
gweinjc 6564a06
MTP test
gweinjc 5a357e3
next build
jworkmanjc fdd0009
Merge branch 'SA-3610_GHA_Workflow_Migrations' of github.com:TheJumpC…
jworkmanjc 7ac25d9
do not ignore required module files
jworkmanjc 6adf639
build before test
jworkmanjc 6fd439c
ci job name update
jworkmanjc d942ceb
Build sdk
jworkmanjc 7af8083
sdk
jworkmanjc df8722f
run clean script on linux host
jworkmanjc 34c8437
update tests for ubuntu
jworkmanjc 110eb0a
exclude MTP tests and build v1 before v2 tests
jworkmanjc 2549cf2
build as artifacts before test
jworkmanjc 67d9931
download artifacts outside matrix
jworkmanjc 7104b10
update path for download atrifact
jworkmanjc 610375a
path name
jworkmanjc 19c30bb
path
jworkmanjc d198eb5
upload all artifacts
jworkmanjc 4ec08e6
artifact path
jworkmanjc 28d87c0
artifact path
jworkmanjc 01e63f1
build test changes
jworkmanjc 861bef6
artifact build and test
jworkmanjc 07c4f36
indentation
jworkmanjc 45c2394
Order of actions
jworkmanjc 99fe863
test build and zip
jworkmanjc 622125c
artifact compress path
jworkmanjc fc453b1
detination paths
jworkmanjc 7d0bbd2
expand archive to correct path
jworkmanjc a76a775
test v2 + invoke pester
jworkmanjc 7d688c8
download v1 artifact if testing v2
jworkmanjc 9991b82
v1 artifact path
jworkmanjc 7634a65
re-test v2 with skipped email test
jworkmanjc 9a89c60
skip email tests + random application name
jworkmanjc d669357
skip email tests
jworkmanjc 92ea0ad
invoke pester tests
jworkmanjc 36a86b8
Missing " for invoke-pester
jworkmanjc 1a2e68e
import-module param
jworkmanjc 341471c
support repo location
jworkmanjc 0b8da6c
path and test module after build
jworkmanjc ce54d95
support path
jworkmanjc 04865e9
just test path
jworkmanjc b8545fb
tree pwd
jworkmanjc 9753487
path and artifact change for invoke pester
jworkmanjc 7b8c290
test support checkout
kmaranionjc cd7a741
Revert "test support checkout"
jworkmanjc 63f5059
path
jworkmanjc f852d12
ignore build for test
jworkmanjc be1670b
case sensitive path
jworkmanjc 33e5fbc
test pester after artifact build
jworkmanjc 8d0c8d4
setup org path
jworkmanjc 9937554
list modules skip deployment tests
jworkmanjc 0392378
disable parallel tests
jworkmanjc e5b601a
skip connectJC tests
jworkmanjc e779c3a
test module validation
kmaranionjc 5c58a60
test
kmaranionjc 39b8c02
module validation + changelog [skip ci]
jworkmanjc 455fe55
test
kmaranionjc b1de6f7
test
kmaranionjc 58bdd57
Merge branch 'SA-3610_GHA_Workflow_Migrations' into SA-3610_GHA_Workf…
jworkmanjc d11aaa2
Merge pull request #65 from TheJumpCloud/SA-3610_GHA_Workflow_Migrati…
jworkmanjc ce94fef
restore tasks from ci
jworkmanjc 636bfe4
no note require merge
jworkmanjc 9b99df3
fix syntax issue with modulevalidation
kmaranionjc 47974ad
changelog and psd1 date update
jworkmanjc 00de783
Merge branch 'SA-3610_GHA_Workflow_Migrations' of github.com:TheJumpC…
jworkmanjc a10b994
set variables from setup org
jworkmanjc 2602346
valuidate backup/ association without other tests
jworkmanjc d5b376a
update backup org tests for linux filesystem
jworkmanjc 837b009
test backupOrg with different path
jworkmanjc 467a4b3
Add run command endpoint
kmaranionjc d949552
Merge branch 'SA-3610_GHA_Workflow_Migrations' of https://github.com/…
kmaranionjc d5c065a
publish module locally and install for parallel jobs
jworkmanjc 43e2c9c
Merge branch 'SA-3610_GHA_Workflow_Migrations' of github.com:TheJumpC…
jworkmanjc f645fd3
CI path for module publish
jworkmanjc 4ec13ae
revert to tags
jworkmanjc 097b1e4
validate module swagger specs are up to date
jworkmanjc ff67165
do not ignore custom/generated
jworkmanjc 4860d35
SDK commit with Start-JCSdkCommand
jworkmanjc a4c7c5f
Changelog date
jworkmanjc 5cef299
add Build.ps1
jworkmanjc 31eab4d
require dependancies for module validation [skip ci]
jworkmanjc 16567b3
Add run command test
kmaranionjc 4a4e550
Merge branch 'SA-3610_GHA_Workflow_Migrations' of https://github.com/…
kmaranionjc 0a8a384
Update Build + automatic gitignore changes
jworkmanjc 256192f
SDK date + changelog
jworkmanjc aee1a1c
use chached pwsh modules before validate module
jworkmanjc f010587
test release workflow
jworkmanjc b581814
test release workflow
jworkmanjc 8802e3d
release steps
jworkmanjc 9cccabc
changelog capture
jworkmanjc c848a07
quotes
jworkmanjc 31aa293
pack on CI + draft changes
jworkmanjc 2a1735b
draft + pack variables
jworkmanjc ed0648a
setuporg + zip artifacts for release
jworkmanjc 8d46ec9
ignore datetime in swagger spec diff
jworkmanjc 540ba84
start jcsdkCommand tests
jworkmanjc 31d3352
skip pester tests + update date
jworkmanjc 354550b
revert release pipeline
jworkmanjc 8d14f8f
cleanup + codeowners
jworkmanjc 28cf41a
remove circleCI
jworkmanjc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# jcapi-powershell Code Owners | ||
|
||
* @TheJumpCloud/solutions-architecture |
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,113 @@ | ||
name: Release and Publish SDKs | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
branches: | ||
- master | ||
jobs: | ||
Check-If-Merged: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if Merged | ||
run: echo {GITHUB_HEAD_REF} merged into master | ||
Check-PR-Labels: | ||
needs: ["Check-If-Merged"] | ||
runs-on: ubuntu-latest | ||
outputs: | ||
RELEASE_TYPE: ${{ steps.validate.outputs.RELEASE_TYPE }} | ||
steps: | ||
- name: Validate-PR-Version-Labels | ||
id: validate | ||
shell: pwsh | ||
run: | | ||
$PR_LABEL_LIST=$(curl -s "https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels" | jq -r '.[].name') | ||
if ("SDK" -in $PR_LABEL_LIST) { | ||
write-host "Starting Build for PowerShell SDK Release" | ||
} | ||
# validate type from label list: | ||
$types = @('major', 'minor', 'patch', 'manual') | ||
$typeCount = 0 | ||
foreach ($item in $PR_LABEL_LIST) { | ||
if ($item -in $types) { | ||
write-host "$item" | ||
$typeCount += 1 | ||
$RELEASE_TYPE = $item | ||
} | ||
} | ||
if ($typeCount -eq 1) { | ||
echo "RELEASE_TYPE=$RELEASE_TYPE" >> $env:GITHUB_OUTPUT | ||
} else { | ||
throw "Multiple or invalid release types were found on PR" | ||
exit 1 | ||
} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Draft-GH-Release: | ||
needs: ['Check-PR-Labels'] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
sdkName: ['JumpCloud.SDK.V1','JumpCloud.SDK.V2','JumpCloud.SDK.DirectoryInsights'] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Zip SDK Directory | ||
run: | | ||
cd ${{ github.workspace }}/SDKs/PowerShell/${{ matrix.sdkName }}/; | ||
zip -r ${{ github.workspace }}/SDKs/PowerShell/${{ matrix.sdkName }}.zip ./* | ||
- name: Build Draft Release | ||
run: | | ||
MODULE_CAPTURE=$(grep -Po "ModuleVersion = '(\d+\.\d+\.\d+)'" ${{ github.workspace }}/SDKs/PowerShell/${{ matrix.sdkName }}/${{ matrix.sdkName }}.psd1) | ||
VERSION=$(echo $MODULE_CAPTURE | grep -Po "(\d+\.\d+\.\d+)") | ||
TITLE="${{ matrix.sdkName }}-$VERSION" | ||
# Get the changelog text between the latest release # and the next sequential "## SemanticVersionNumber" | ||
CHANGELOG=$(cat ${{ github.workspace }}/${{ matrix.sdkName }}.md | awk "/^## ${{ matrix.sdkName }}-$VERSION/{ f = 1; next } /## ${{ matrix.sdkName }}-[0-9]+.[0-9]+.[0-9]+/{ f = 0 } f") | ||
BODY="$TITLE $CHANGELOG" | ||
TAG="${{ matrix.sdkName }}-$VERSION" | ||
BODY="$TITLE $CHANGELOG" | ||
# draft release | ||
(gh release view $TAG && echo "Release exists for $TAG") || gh release create $TAG --title "$TITLE" --notes "$BODY" --draft | ||
# add artifact: | ||
gh release upload $TAG ${{ github.workspace }}/SDKs/PowerShell/${{ matrix.sdkName }}.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
Manual-Approval-Release: | ||
needs: ["Draft-GH-Release"] | ||
environment: PublishToPSGallery | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Manual Approval for Release | ||
run: echo "Awaiting approval from required reviewers before continuing" | ||
Deploy-Nupkg: | ||
needs: ['Manual-Approval-Release'] | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
SDKName: ['JumpCloud.SDK.DirectoryInsights', 'JumpCloud.SDK.V1', 'JumpCloud.SDK.V2'] | ||
steps: | ||
- name: Download SDK Artifact | ||
run: | | ||
WF_NAME="jcapi-powershell-ci.yml" | ||
ARTIFACT_NAME="build-${{ matrix.SDKName }}" | ||
RUN_ID=`gh run --repo ${{ github.repository }} list --workflow ${WF_NAME} --branch ${{ github.ref_name }} --json databaseId --jq .[0].databaseId` | ||
gh run --repo ${{ github.repository }} download ${RUN_ID} -n ${ARTIFACT_NAME} | ||
# List the artifiact directory/files | ||
ls -lR | ||
unzip ${{ matrix.SDKName }}.zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Publish SDKs | ||
shell: pwsh | ||
run: | | ||
# finally remove source PSGallery and add again with the v2/package path for publishing | ||
dotnet nuget remove source PSGallery | ||
dotnet nuget add source "https://www.powershellgallery.com/api/v2/package" --name PSGallery | ||
$NupkgPath = (Get-ChildItem -Path:("./${{ matrix.sdkName }}/bin/nupkg/${{ matrix.sdkName }}*.nupkg")).FullName | ||
write-host "push ${{ matrix.sdkName }} to psgallery" | ||
# nuget push from here: | ||
dotnet nuget push $NupkgPath --source PSGallery --api-key $env:NuGetApiKey | ||
env: | ||
NuGetApiKey: ${{ secrets.NUGETAPIKEY }} |
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
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
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
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
required to update .gitignore files