Skip to content

Workflow file for this run

name: Nuget package publish and release
on:
release:
types: [released]
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
jobs:
nuget:
name: 📦 Nuget - Publish package
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: 🟣 Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: 📦 Pack
run: |
dotnet pack SpeciesDatabaseApi --configuration Release --output .
- name: 🚀 Push nuget.org
run: dotnet nuget push SpeciesDatabaseApi*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} --skip-duplicate
publish:
name: Publish for ${{ matrix.os_identifier }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
os_identifier: linux-x64
publish_folder: "SpeciesDatabaseCmd_${{ matrix.os_identifier }}_${{ github.ref_name }}"

Check failure on line 44 in .github/workflows/package-publish.yml

View workflow run for this annotation

GitHub Actions / Nuget package publish and release

Invalid workflow file

The workflow is not valid. .github/workflows/package-publish.yml (Line: 44, Col: 29): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.os_identifier .github/workflows/package-publish.yml (Line: 45, Col: 28): Unrecognized named-value: 'matrix'. Located at position 1 within expression: matrix.publish_folder
artifact_name: "${{ matrix.publish_folder }}.zip"
- os: windows-latest
os_identifier: win-x64
publish_folder: "SpeciesDatabaseCmd_${os_identifier}_${{ github.ref_name }}"
artifact_name: "${{ matrix.publish_folder }}.zip"
- os: macos-latest
os_identifier: osx-x64
publish_folder: "SpeciesDatabaseCmd_${os_identifier}_${{ github.ref_name }}"
artifact_name: "${{ matrix.publish_folder }}.zip"
- os: macos-latest
os_identifier: osx-arm64
publish_folder: "SpeciesDatabaseCmd_${os_identifier}_${{ github.ref_name }}"
artifact_name: "${{ matrix.publish_folder }}.zip"
steps:
- name: 🛒 Checkout
uses: actions/checkout@v3
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: 🟣 Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: 🔧 Build
run: |
dotnet publish SpeciesDatabaseCmd -o ${{ matrix.publish_folder }} -c Release -r ${{ matrix.os_identifier }} -p:PublishReadyToRun=true --self-contained
- name: 📦 Zip
uses: vimtor/action-zip@v1
with:
files: ${{ matrix.publish_folder }}/
recursive: true
dest: ${{ matrix.artifact_name }}
- name: 🚀 Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
asset_name: ${{ matrix.artifact_name }}
tag: ${{ github.ref }}