0.6.0 #129
Workflow file for this run
This file contains hidden or 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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - "*" | |
| permissions: | |
| packages: write | |
| contents: write | |
| env: | |
| mod_namespace: 'MT2' | |
| mod_name: 'Steward_Clan' | |
| base_version: '0.1.0' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: '9.0.x' | |
| - name: Install Thunderstore | |
| run: | | |
| dotnet tool install --global tcli | |
| - name: Set VERSION Variable | |
| run: | | |
| if [[ "$GITHUB_REF" == refs/tags/* ]]; then | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| echo "VERSION=$TAG_NAME" >> $GITHUB_ENV | |
| else | |
| echo "VERSION=${{ env.base_version }}-preview.${{ github.run_number }}" >> $GITHUB_ENV | |
| fi | |
| - name: Setup NuGet Credentials | |
| run: | | |
| dotnet nuget update source monster-train-packages -u USERNAME -p ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text | |
| - name: Restore Dependencies | |
| run: dotnet restore | |
| - name: Setup Directory | |
| run: mkdir -p plugin_build | |
| - name: Build Release | |
| run: dotnet build StewardClan.Plugin -c Release --no-restore --output ./plugin_build/plugins /p:Version=${VERSION} | |
| - name: Build thunderstore package | |
| run: | | |
| tcli build | |
| - name: Upload Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-bundle | |
| path: ${{ env.mod_namespace }}-${{ env.mod_name }}-${{ github.ref_name }}.zip | |
| - name: Release | |
| uses: softprops/action-gh-release@v2 | |
| if: startsWith(github.ref, 'refs/tags/') | |
| with: | |
| files: ${{ env.mod_namespace }}-${{ env.mod_name }}-${{ github.ref_name }}.zip | |
| prerelease: true | |
| generate_release_notes: true | |
| - name: Publish to Thunderstore | |
| run: tcli publish --file "${{ env.mod_namespace }}-${{ env.mod_name }}-${{ github.ref_name }}.zip" --token ${{ secrets.TCLI_AUTH_TOKEN }} | |
| if: startsWith(github.ref, 'refs/tags/') |