Use standard GITHUB_TOKEN #78
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
name: CICD | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
env: | |
DOTNET_NOLOGO: true | |
SLN: ${{ github.workspace }}/src/NQuery.sln | |
BIN: ${{ github.workspace }}/bin/ | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Get code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # We need the full history in order to use Git versioning | |
- name: Get .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '8.0.*' | |
- name: dotnet build | |
run: | | |
dotnet build ${env:SLN} -c Release --nologo -o ${env:BIN} | |
- name: dotnet test | |
run: | | |
dotnet test ${env:SLN} --nologo | |
- name: Upload binaries | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'terrajobst' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: bin | |
path: bin | |
push-to-github: | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository_owner == 'terrajobst' | |
needs: build | |
runs-on: ubuntu-latest | |
permissions: | |
packages: write | |
steps: | |
- name: Download binaries | |
uses: actions/download-artifact@v4.1.7 | |
with: | |
name: bin | |
path: .artifacts/bin | |
- run: | | |
dotnet nuget push .artifacts/bin/*.nupkg -s "https://nuget.pkg.github.com/terrajobst/index.json" -k ${{ secrets.GITHUB_TOKEN }} |