Merge pull request #8 from mjczone/develop #10
Workflow file for this run
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
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8 | |
source-url: https://nuget.pkg.github.com/mjczone/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} #github action provided token | |
- name: Set VERSION_NUMBER variable from tag | |
run: echo "VERSION_NUMBER=${GITHUB_REF_NAME/v/}" >> $GITHUB_ENV | |
- name: Build | |
run: dotnet build --configuration Release /p:Version=${VERSION_NUMBER} | |
- name: Test | |
run: | | |
dotnet test --configuration Release /p:Version=${VERSION_NUMBER} --no-build | |
# replace VERSION_NUMBER in docs/docs.config.json with ${VERSION_NUMBER} | |
sed -i "s/VERSION_NUMBER/${VERSION_NUMBER}/g" docs/docs.config.json | |
- name: Pack | |
run: dotnet pack --configuration Release /p:Version=${VERSION_NUMBER} --no-build --output nupkgs | |
- name: Push | |
run: dotnet nuget push nupkgs/${PACKAGE_ID}.${VERSION_NUMBER}.nupkg | |
env: | |
PACKAGE_ID: "MJCZone.DapperMatic" | |
- name: Upload Pages Artifact | |
uses: actions/upload-pages-artifact@v3 | |
with: | |
path: docs/ | |
# Deploy to GitHub Pages | |
deploy: | |
needs: build | |
permissions: | |
pages: write | |
id-token: write | |
environment: | |
name: github-pages | |
url: ${{ steps.deployment.outputs.page_url }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deploy to GitHub Pages | |
id: deployment | |
uses: actions/deploy-pages@v4 |