diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d9a7ce1..d57da3d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,13 +7,14 @@ on: tags: - v** # Only when a v... tag is pushed -# Sets permissions of the GITHUB_TOKEN to allow reading packages and push releases +# Sets permissions of the GITHUB_TOKEN to allow writing packages and push releases permissions: - packages: read + packages: write env: DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_NOLOGO: true + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NuGetDirectory: ${{ github.workspace}}/nuget @@ -30,6 +31,9 @@ jobs: runs-on: ubuntu-latest needs: [ build ] steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Download NuGet Packages Artifact uses: actions/download-artifact@v4 with: @@ -39,8 +43,6 @@ jobs: - name: Build Changelog id: build_changelog uses: mikepenz/release-changelog-builder-action@v4 - #env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Create Release uses: mikepenz/action-gh-release@v1 #softprops/action-gh-release @@ -73,5 +75,5 @@ jobs: - name: Publish NuGet Packages run: | foreach($file in (Get-ChildItem "${{ env.NuGetDirectory }}" -Recurse -Include *.nupkg)) { - dotnet nuget push $file --api-key "${{ secrets.NUGET_APIKEY }}" --source https://nuget.pkg.github.com/MonkeyModdingTroop/index.json --skip-duplicate + dotnet nuget push $file --api-key "${{ secrets.GITHUB_TOKEN }}" --source https://nuget.pkg.github.com/MonkeyModdingTroop/index.json --skip-duplicate } \ No newline at end of file