Add references in .csproj #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish | |
on: | |
release: | |
types: [prereleased, released] | |
push: | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.release.tag_name }} | |
fetch-depth: 0 | |
filter: tree:0 | |
- name: Setup .NET environment | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8' | |
- name: Install Thunderstore CLI | |
run: | | |
dotnet tool install -g tcli | |
- name: Restore Dependencies | |
run: dotnet restore | |
- name: Compile and build code | |
run: | | |
dotnet build | |
- name: Build and package mod via TCLI | |
run: | | |
tcli build --config-path ./assets/thunderstore.toml | |
- name: Upload Thunderstore artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: thunderstore-build | |
path: dist/*.zip | |
upload-release-artifacts: | |
name: Upload Release Artifacts | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Download all artifacts | |
uses: actions/download-artifact@v4 | |
- name: Upload artifacts to Release | |
run: gh release upload ${{ github.event.release.tag_name }} thunderstore-build/*.zip | |
publish-to-thunderstore: | |
name: Publish to Thunderstore | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Fetch Sources | |
uses: actions/checkout@v4 | |
- name: Download Thunderstore artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: thunderstore-build | |
path: ./dist | |
- name: Validate artifact exists | |
run: test -d ./dist | |
- name: Setup .NET environment | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8' | |
- name: Install Thunderstore CLI | |
run: | | |
dotnet tool install -g tcli | |
- name: Publish to Thunderstore | |
env: | |
TCLI_AUTH_TOKEN: ${{ secrets.THUNDERSTORE_API_TOKEN }} | |
run: | | |
tcli publish --config-path ./assets/thunderstore.toml --file ./dist/*.zip |