Skip to content

24.2.29

24.2.29 #8

Workflow file for this run

name: DotNet- Publish to Nuget
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set env
run: |
echo "VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Print Version
run: |
echo $VERSION
echo ${{ env.VERSION }}
- name: Retrieve bearer token
id: get_bearer_token
run: |
response=$(curl -X POST ${{secrets.OKTA_ACCESS_TOKEN_URL}}/connect/token \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=${{secrets.OKTA_CLIENT_ID}}&client_secret=${{secrets.OKTA_CLIENT_SECRET}}")
token=$(echo $response | jq -r '.access_token')
echo "BEARER_TOKEN=${token}" >> $GITHUB_ENV
echo "CLIENT_ID=${{secrets.CLIENT_ID}}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v2
with:
dotnet-version: |
2.x.x
2.2.x
3.1.x
5.0.x
6.0.x
7.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build Package
run: dotnet build --no-restore --configuration Release /p:Version=${VERSION}
- name: Test cases
run: dotnet test --no-build --verbosity normal --configuration Release /p:Version=${VERSION}
- name: Pack Package
run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output ./nuget
- name: Update resources
uses: test-room-7/action-update-file@v1
with:
file-path: ./**/*.nupkg
commit-msg: Commit Nuget Package
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Push Package
run: dotnet nuget push ./nuget/Avalara.SDK.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{secrets.NUGET_API_TOKEN}}