Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBang1112 authored Jun 19, 2024
1 parent 469586f commit 4e99fc7
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Publish
on:
release:
types: [ published ]

permissions:
contents: write # important for release description edit and asset upload
packages: write

jobs:
build:
Expand All @@ -11,10 +15,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v2
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
8.0.x
Expand All @@ -41,7 +45,7 @@ jobs:
run: dotnet test -c Release --no-build --verbosity normal

- name: Upload a Build Artifact
uses: actions/upload-artifact@v3.1.0
uses: actions/upload-artifact@v4
with:
name: build
path: Src/ManiaAPI.*/bin/Release/*.nupkg
Expand All @@ -52,13 +56,16 @@ jobs:

strategy:
matrix:
lib: [NadeoAPI, NadeoAPI.Extensions.Gbx, TMX, TrackmaniaAPI, TrackmaniaIO, ManiaPlanetAPI, XmlRpc]
lib: [NadeoAPI, NadeoAPI.Extensions.Gbx, TMX, TMX.Extensions.Gbx, TrackmaniaAPI, TrackmaniaIO, ManiaPlanetAPI, XmlRpc]

runs-on: ubuntu-latest

env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

steps:
- name: Download a Build Artifact
uses: actions/download-artifact@v3.0.0
uses: actions/download-artifact@v4
with:
name: build

Expand All @@ -67,11 +74,6 @@ jobs:

- name: Publish the ManiaAPI.${{ matrix.lib }} package to github.com
run: dotnet nuget push ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg -k ${{ secrets.GITHUB_TOKEN }} -s https://nuget.pkg.github.com/bigbang1112/index.json --skip-duplicate

- name: Attach the ManiaAPI.${{ matrix.lib }} package to the release
uses: svenstaro/upload-release-action@v2
with:
file: ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg
file_glob: true
tag: ${{ github.ref }}
overwrite: true
run: gh release upload ${{ github.ref_name }} ManiaAPI.${{ matrix.lib }}/bin/Release/*.nupkg

0 comments on commit 4e99fc7

Please sign in to comment.