Skip to content

publish

publish #73

Workflow file for this run

# Builds a final release version and pushes to nuget.org
# whenever a release is published.
# Requires: secrets.NUGET_API_KEY
name: publish
on:
workflow_dispatch:
release:
types: [prereleased, released] # pre-release
env:
DOTNET_NOLOGO: true
Configuration: Release
PackOnBuild: true
VersionLabel: ${{ github.ref }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
- name: 🙏 build
run: dotnet build -m:1
- name: ⚙ azurite
run: |
npm install azurite
npx azurite &
- name: 🧪 test
env:
GH_TOKEN: ${{ secrets.GH_TOKEN || secrets.GITHUB_TOKEN }}
run: dotnet test
- name: 🚀 sleet
env:
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
if: env.SLEET_CONNECTION != ''
run: |
dotnet tool install -g --version 4.0.18 sleet
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
- name: 🚀 nuget
if: github.ref_type == 'tag'
working-directory: bin
run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
- name: ⬆️ upload
if: success()
uses: actions/upload-artifact@v4
with:
name: pkg
path: bin/*
deploy:
needs: build
runs-on: ubuntu-latest
steps:
- name: 🤘 checkout
uses: actions/checkout@v4
- name: 🔓 login
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}
- name: ⚙ func 4.x
run: npm i -g azure-functions-core-tools@4 --unsafe-perm true
- name: 🚀 deploy
working-directory: src/Web
run: func azure functionapp publish sponsorlink --dotnet-isolated