Skip to content

deps

deps #18

name: release
on:
push:
branches: [ "master" ]
jobs:
build:
runs-on: windows-latest
env:
Configuration: Release
Version: ${{ vars.MAJORVERSION }}.${{ vars.MINORVERSION }}.${{ github.run_number }}.${{ vars.REVISION }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8
- name: Restore
run: dotnet restore /p:Configuration=${{ env.Configuration }} --verbosity normal
- name: Build
run: dotnet build --configuration ${{ env.Configuration }} --no-restore /p:Version=${{ env.Version }} --verbosity normal
- name: Test
run: dotnet test --configuration ${{ env.Configuration }} --no-build /p:Version=${{ env.Version }} --verbosity normal
- name: Pack
run: dotnet pack --configuration ${{ env.Configuration }} --no-build /p:Version=${{ env.Version }} --verbosity normal --output .packages
- name: Push to GitHub Packages
run: dotnet nuget push .packages\*.nupkg --source https://nuget.pkg.github.com/FizzcodeSoftware/index.json --api-key ${{ secrets.GITHUB_TOKEN }}
- name: Push to nuget.org
run: dotnet nuget push .packages\*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${{ secrets.NUGET_ORG_APIKEY }}
- name: Create tag
uses: actions/github-script@v7
with:
script: |
github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: 'refs/tags/v${{ env.Version }}',
sha: context.sha
})