Skip to content

Publish Pre-Release

Publish Pre-Release #5

Workflow file for this run

name: Publish Pre-Release
on:
release:
types:
- prereleased
jobs:
publish-job:
runs-on: ubuntu-latest
env:
PROJECT_FOLDER: ./JQLBuilder
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v4
with:
dotnet-version: "8.0.x"
# running tests for all projects in the solution
- name: Test
run: dotnet test . --verbosity quiet
# determining the version of the package to be published
- name: Determine package version
run: echo "VERSION=${{ github.event.release.tag_name }}.$(git rev-parse --short ${{ github.sha }})" >> $GITHUB_ENV
# publishing the package
- name: Publish
working-directory: ${{ env.PROJECT_FOLDER }}
run: |
dotnet pack --configuration Release --output ./artifacts /p:Version=${{ env.VERSION }}
dotnet nuget push ./artifacts/*.nupkg --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{ secrets.SQLBUILDER_NUGET_API_KEY }}