Skip to content

Workflow file for this run

name: Upload dotnet package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
- uses: actions/[email protected]
with:
dotnet-version: '8.0.x' # SDK Version to use.
source-url: https://nuget.pkg.github.com/polimaster/index.json
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
- name: Define variables
run: |
tag=$(git describe --tags --abbrev=0)
echo "tag=$tag" >> "$GITHUB_ENV"
echo "src=src/Polimaster.Device.Transport.Http/Polimaster.Device.Transport.Http" >> "$GITHUB_ENV"
- name: Build
run: dotnet build "$src" -c Release -p:AssemblyVersion="$tag" -p:Version="$tag"
env:
# see https://github.com/actions/setup-dotnet/issues/543
NuGetPackageSourceCredentials_github.polimaster: Username=${{ github.actor }};Password=${{ secrets.GITHUB_TOKEN }}
# - name: Run tests
# run: dotnet test "$src.Tests"
- name: Create the package
run: dotnet pack "$src" -c Release -p:AssemblyVersion="$tag" -p:Version="$tag"
- name: Publish the package to GPR
run: dotnet nuget push "$src/bin/Release/*.nupkg"