-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Victor Chang <[email protected]>
- Loading branch information
Showing
2 changed files
with
77 additions
and
0 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 |
---|---|---|
|
@@ -308,6 +308,7 @@ jobs: | |
runs-on: ${{ matrix.os }} | ||
needs: [calc-version] | ||
env: | ||
NUGETVER: ${{ needs.calc-version.outputs.nuGetVersionV2 }} | ||
SEMVER: ${{ needs.calc-version.outputs.semVer }} | ||
PRERELEASELABEL: ${{ needs.calc-version.outputs.preReleaseLabel }} | ||
MAJORMINORPATCH: ${{ needs.calc-version.outputs.majorMinorPatch }} | ||
|
@@ -381,12 +382,32 @@ jobs: | |
popd | ||
dir -r ~/release | ||
- name: Package API | ||
env: | ||
PACKAGEDIR: '${{ github.workspace }}/nupkg/' | ||
if: ${{ (matrix.os == 'ubuntu-latest') }} | ||
run: | | ||
mkdir $PACKAGEDIR | ||
dotnet pack --no-build -c ${{ env.BUILD_CONFIG }} -o $PACKAGEDIR -p:PackageVersion=${{ env.NUGETVER }} | ||
ls -lR $PACKAGEDIR | ||
working-directory: ./src/Api | ||
|
||
- name: Upload CLI | ||
uses: actions/[email protected] | ||
with: | ||
name: artifacts | ||
path: ~/release | ||
retention-days: 7 | ||
|
||
- name: Upload Nuget | ||
if: ${{ matrix.os == 'ubuntu-latest' }} | ||
uses: actions/[email protected] | ||
env: | ||
PACKAGEDIR: '${{ github.workspace }}/nupkg/' | ||
with: | ||
name: nuget | ||
path: ${{ PACKAGEDIR }}*.nupkg | ||
retention-days: 30 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/[email protected] | ||
|
@@ -501,6 +522,31 @@ jobs: | |
name: artifacts | ||
path: ~/release | ||
retention-days: 7 | ||
|
||
publish: | ||
name: Publish to GitHub Packages | ||
runs-on: ubuntu-latest | ||
needs: [build, unit-test] | ||
if: ${{ ! ( github.event.inputs.nuget ) && ! ( contains(github.ref, 'refs/heads/main') ) }} | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
id: download | ||
|
||
- name: List artifacts | ||
run: ls -ldR ${{steps.download.outputs.download-path}}/**/* | ||
|
||
- name: Install grp | ||
run: dotnet tool install gpr -g | ||
|
||
- uses: actions/setup-dotnet@v3 | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
dotnet-version: "6.0.x" | ||
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json | ||
|
||
- name: Publish to GitHub | ||
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }} | ||
|
||
release: | ||
if: ${{ contains(github.ref, 'refs/heads/main') || contains(github.ref, 'refs/heads/develop') ||contains(github.head_ref, 'release/') || contains(github.head_ref, 'feature/') || contains(github.head_ref, 'develop') }} | ||
|
@@ -521,6 +567,22 @@ jobs: | |
|
||
- name: List artifacts | ||
run: ls -ldR ${{steps.download.outputs.download-path}}/**/* | ||
|
||
- name: Install grp | ||
run: dotnet tool install gpr -g | ||
|
||
- uses: actions/setup-dotnet@v3 | ||
env: | ||
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
with: | ||
dotnet-version: "6.0.x" | ||
source-url: https://nuget.pkg.github.com/Project-MONAI/index.json | ||
|
||
- name: Publish to GitHub | ||
run: gpr push '${{ steps.download.outputs.download-path }}/nuget/*.nupkg' --repository ${{ github.repository }} -k ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Publish to NuGet.org | ||
run: dotnet nuget push ${{ steps.download.outputs.download-path }}/nuget/*.nupkg -s https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET }} --skip-duplicate | ||
|
||
- name: Extract owner and repo | ||
uses: jungwinter/split@v2 | ||
|
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