-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
task: Build on GHA and publish to GPR (#16)
- Loading branch information
Showing
4 changed files
with
64 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
packages: write | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: [self-hosted, nonroot] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # avoid shallow clone so nbgv can do its work. | ||
- name: Inject slug/short variables | ||
uses: rlespinasse/github-slug-action@v4 | ||
with: | ||
prefix: CI_ | ||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: | | ||
6.x | ||
3.1.x | ||
- name: Restore dependencies | ||
run: dotnet restore | ||
- name: Nerdbank.GitVersioning | ||
id: nbgv | ||
uses: dotnet/[email protected] | ||
- name: Build version (master) | ||
if: env.CI_GITHUB_REF_SLUG == 'master' | ||
run: echo "PUBLISH_VERSION=${{ steps.nbgv.outputs.SimpleVersion }}.${{ steps.nbgv.outputs.VersionHeight }}" >> $GITHUB_ENV | ||
- name: Build version (PR) | ||
if: env.CI_GITHUB_REF_SLUG != 'master' | ||
run: echo "PUBLISH_VERSION=${{ steps.nbgv.outputs.SimpleVersion }}.${{ steps.nbgv.outputs.VersionHeight }}-${{ env.CI_GITHUB_HEAD_REF_SLUG }}" >> $GITHUB_ENV | ||
- name: Build | ||
run: dotnet build --configuration Release -p:Version=${{ env.PUBLISH_VERSION }} --no-restore | ||
- name: Pack | ||
run: dotnet pack --configuration Release --no-build -p:PackageVersion=${{ env.PUBLISH_VERSION }} | ||
- name: Push | ||
run: dotnet nuget push **EPPlus.HTML/bin/Release/*.nupkg --api-key ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/urbansportsclub/index.json --skip-duplicate --no-symbols |
This file was deleted.
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
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,15 @@ | ||
{ | ||
"$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/master/src/NerdBank.GitVersioning/version.schema.json", | ||
"version": "1.0.0", | ||
"assemblyVersion": { | ||
"precision": "revision" | ||
}, | ||
"publicReleaseRefSpec": [ | ||
"^refs/heads/master$" | ||
], | ||
"cloudBuild": { | ||
"buildNumber": { | ||
"enabled": true | ||
} | ||
} | ||
} |