Cleanup #2
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
name: Publish Preview to NuGet | |
on: | |
push: | |
tags: | |
- "v[0-9]+.[0-9]+.[0-9]+-preview-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-alpha-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-beta-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-prerelease-[0-9]+" | |
- "v[0-9]+.[0-9]+.[0-9]+-rc-[0-9]+" | |
jobs: | |
preview: | |
name: publish preview | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: 🔨 set up .net 7 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: ⚗ restore dependencies | |
run: dotnet restore src | |
- name: 🛠 build | |
run: dotnet build src --configuration Release --no-restore | |
- name: 🔢 set VERSION variable from tag | |
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV | |
- name: 🎁 pack nuget | |
run: dotnet pack src/LazyCart/LazyCart.csproj --configuration Release --include-symbols /p:SymbolPackageFormat=snupkg /p:ContinuousIntegrationBuild=true /p:Version=${VERSION} --output . | |
- name: 💌 publish preview nuget | |
run: dotnet nuget push *.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_KEY} --skip-duplicate | |
env: | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} |