diff --git a/.github/workflows/dotnet-pack.yml b/.github/workflows/dotnet-pack.yml index e04bbd2..02c410d 100644 --- a/.github/workflows/dotnet-pack.yml +++ b/.github/workflows/dotnet-pack.yml @@ -38,27 +38,13 @@ jobs: with: script: | const fs = require('fs'); - var jsonData = JSON.parse(`${{steps.run.outputs.LASTLINE}}`); - core.setOutput("PublishNUPKG", jsonData.PublishNUPKG && fs.existsSync(jsonData.OutputDirectory + "/NUPKG")); - core.setOutput("PublishTSPKG", jsonData.PublishTSPKG && fs.existsSync(jsonData.OutputDirectory + "/TSPKG")); - core.setOutput("PublishNMPKG", jsonData.PublishNMPKG && fs.existsSync(jsonData.OutputDirectory + "/NMPKG")); - core.setOutput("PKGSDIR", jsonData.OutputDirectory); + core.setOutput("OutputDir", `${{steps.run.outputs.LASTLINE}}`); - uses: actions/upload-artifact@v4 - if: ${{steps.attain-fileinfo.outputs.PublishNUPKG == 'true'}} + if: ${{steps.attain-fileinfo.outputs.OutputDir != ''}} with: name: NUPKG - path: ${{steps.attain-fileinfo.outputs.PKGSDIR}}/NUPKG - - uses: actions/upload-artifact@v4 - if: ${{steps.attain-fileinfo.outputs.PublishTSPKG == 'true'}} - with: - name: TSPKG - path: ${{steps.attain-fileinfo.outputs.PKGSDIR}}/TSPKG - - uses: actions/upload-artifact@v4 - if: ${{steps.attain-fileinfo.outputs.PublishNMPKG == 'true'}} - with: - name: NMPKG - path: ${{steps.attain-fileinfo.outputs.PKGSDIR}}/NMPKG + path: ${{steps.attain-fileinfo.outputs.OutputDir}} publish-it: name: Publish .NET Results @@ -74,30 +60,12 @@ jobs: - id: attain-file-paths run: | - for file in ./NUPKG/*.nupkg; do + for file in ./*.nupkg; do if [ -e "$file" ]; then echo "NUPKG=$file" >> $GITHUB_OUTPUT break fi done - for file in ./TSPKG/*.zip; do - if [ -e "$file" ]; then - echo "TSPKG=$file" >> $GITHUB_OUTPUT - break - fi - done - for file in ./TSPKG/*.toml; do - if [ -e "$file" ]; then - echo "TSTOML=$file" >> $GITHUB_OUTPUT - break - fi - done - for file in ./NMPKG/*.zip; do - if [ -e "$file" ]; then - echo "NMPKG=$file" >> $GITHUB_OUTPUT - break - fi - done - name: Publish to Github Packages if: ${{steps.attain-file-paths.outputs.NUPKG != ''}} @@ -106,36 +74,8 @@ jobs: dotnet nuget push "${{steps.attain-file-paths.outputs.NUPKG}}" --api-key $GH_TOKEN --source "github" gh release upload ${{ github.event.release.tag_name }} "${{steps.attain-file-paths.outputs.NUPKG}}" - - name: Publish to Github Release Files - if: ${{steps.attain-file-paths.outputs.TSPKG != ''}} - run: | - gh release upload ${{ github.event.release.tag_name }} "${{steps.attain-file-paths.outputs.TSPKG}}" - - name: Publish to Nuget if: ${{steps.attain-file-paths.outputs.NUPKG != '' && github.event.release.prerelease == false}} run: | dotnet nuget push "${{steps.attain-file-paths.outputs.NUPKG}}" --api-key ${{ secrets.NUGET_API_TOKEN }} --source https://api.nuget.org/v3/index.json - - - run: npm i @iarna/toml@1.7.1 - - uses: actions/github-script@v7 - if: ${{steps.attain-file-paths.outputs.TSTOML != ''}} - id: attain-ts-token - with: - script: | - const fs = require('fs'); - const toml = require('@iarna/toml'); - const tomlPath = `${{steps.attain-file-paths.outputs.TSTOML}}`; - const fileContent = fs.readFileSync(tomlPath, 'utf8'); - const parsedToml = toml.parse(fileContent); - const repository = parsedToml.publish?.repository; - console.log(`Repository: ${repository}`); - - core.setOutput('TCLI_TOKEN', repository.trimEnd('/').endsWith('.dev') ? `${{secrets.TCLI_DEV_API_TOKEN}}` : `${{secrets.TCLI_API_TOKEN}}`) - - - name: Publishing to Thunderstore - if: ${{steps.attain-file-paths.outputs.TSPKG != '' && steps.attain-file-paths.outputs.TSTOML != '' && github.event.release.prerelease == false}} - env: - TCLI_AUTH_TOKEN: ${{ steps.attain-ts-token.outputs.TCLI_TOKEN }} - run: | - dotnet tool install tcli --create-manifest-if-needed - dotnet tool run tcli publish --config-path "${{steps.attain-file-paths.outputs.TSTOML}}" --file "${{steps.attain-file-paths.outputs.TSPKG}}" + \ No newline at end of file diff --git a/README.md b/README.md index 2cb1358..fe5954c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# - +# VSModReference +Allows MSBuild projects to use a `` tag to reference [VSModDB](https://mods.vintagestory.at/) | https://github.com/anegostudios/vsmoddb mods. ### Support Please reach out on Discord: [Daydreaming](https://discord.gg/Mherqbcmep), or create an issue on the repository here! diff --git a/VSModReference/VSModReference.csproj b/VSModReference/VSModReference.csproj index 661cc23..58aeb29 100644 --- a/VSModReference/VSModReference.csproj +++ b/VSModReference/VSModReference.csproj @@ -6,4 +6,5 @@ enable + diff --git a/VSModReference/icon.png b/VSModReference/icon.png new file mode 100644 index 0000000..f1d57c0 Binary files /dev/null and b/VSModReference/icon.png differ diff --git a/dotnet-common b/dotnet-common index 415ed5e..a18d8a6 160000 --- a/dotnet-common +++ b/dotnet-common @@ -1 +1 @@ -Subproject commit 415ed5eb6352eb177113a2adee931c25a89da3c8 +Subproject commit a18d8a686f1e6f57fd6e562984e40dd7edee3bd7