Skip to content

GBX.NET 2.0.5

GBX.NET 2.0.5 #45

Workflow file for this run

name: Publish
on:
release:
types: [ published ]
permissions:
contents: write # important for release description edit and asset upload
packages: write
jobs:
prepare-description:
name: Set release description
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set release information
run: gh release edit ${{ github.ref_name }} -n "$(echo -e '***[Release is being automatically created, please wait...](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }})***\n\n${{ github.event.release.body }}')"
build:
needs: prepare-description
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
6.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build -c Release --no-restore /p:ContinuousIntegrationBuild=true
- name: Test
run: dotnet test -c Release --no-build --verbosity normal
- name: Upload a Build Artifact
uses: actions/[email protected]
with:
name: build
path: Src/GBX.NET*/bin/Release/*.*nupkg
publish:
needs: build
strategy:
matrix:
lib: [GBX.NET, GBX.NET.Hashing, GBX.NET.Imaging, GBX.NET.Imaging.SkiaSharp, GBX.NET.LZO, GBX.NET.ZLib, GBX.NET.NewtonsoftJson]
name: Publish ${{ matrix.lib }}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Download a Build Artifact
uses: actions/[email protected]
with:
name: build
- name: Publish ${{ matrix.lib }} package to nuget.org
run: dotnet nuget push ${{ matrix.lib }}/bin/Release/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json --skip-duplicate
- name: Publish ${{ matrix.lib }} nupkg to github.com
run: dotnet nuget push ${{ matrix.lib }}/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json --skip-duplicate
- name: Upload ${{ matrix.lib }} nupkg to this release
run: gh release upload ${{ github.ref_name }} ${{ matrix.lib }}/bin/Release/*.nupkg
finalize-description:
needs: publish
runs-on: ubuntu-latest
name: Finalize release description
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
- name: Set release information
run: gh release edit ${{ github.ref_name }} -n "$(echo -e '${{ github.event.release.body }}\n\nAssets were automatically generated using the [publish workflow](https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}).')"