📦 Release #11
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: "📦 Release" | |
| on: | |
| # Make a release whenever the developer wants. | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| type: choice | |
| description: "version bump method: major, minor, or patch" | |
| required: true | |
| default: "patch" | |
| options: | |
| - major | |
| - minor | |
| - patch | |
| jobs: | |
| release: | |
| name: "📦 Release" | |
| runs-on: ubuntu-latest | |
| env: | |
| DOTNET_CLI_TELEMETRY_OPTOUT: true | |
| DOTNET_NOLOGO: true | |
| steps: | |
| - name: 🧾 Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| lfs: true | |
| submodules: "recursive" | |
| fetch-depth: 0 # So we can get all tags. | |
| - name: 🔎 Read Current Project Version | |
| id: current-version | |
| run: | | |
| echo "tag=$(git tag --sort=v:refname | grep -E '^[^v]' | tail -1)" >> "$GITHUB_OUTPUT" | |
| - name: 🖨 Print Current Version | |
| run: | | |
| echo "Current Version: ${{ steps.current-version.outputs.tag }}" | |
| - name: 🧮 Compute Next Version | |
| uses: chickensoft-games/next-godot-csproj-version@v1 | |
| id: next-version | |
| with: | |
| project-version: ${{ steps.current-version.outputs.tag }} | |
| # This action was designed to pin versions to Godot versions, but | |
| # if you pass a stable version in it just bumps the project version | |
| # that you give it. | |
| godot-version: 1.0.0 | |
| bump: ${{ inputs.bump }} | |
| - uses: actions/setup-dotnet@v4 | |
| name: 💽 Setup .NET SDK | |
| with: | |
| # Use the .NET SDK from global.json in the root of the repository. | |
| global-json-file: global.json | |
| - name: 📝 Write Diagram Generator Version to File | |
| uses: jacobtomlinson/gha-find-replace@v3 | |
| with: | |
| find: "0.0.0-devbuild" | |
| replace: ${{ steps.next-version.outputs.version }} | |
| regex: false | |
| include: src/Chickensoft.UMLGenerator/Chickensoft.UMLGenerator.csproj | |
| - name: 📦 Build | |
| run: | | |
| dotnet build \ | |
| src/Chickensoft.UMLGenerator/Chickensoft.UMLGenerator.csproj -c Release | |
| - name: 🔎 Get Generator Package Path | |
| id: gen-package-path | |
| run: | | |
| package=$(find src/Chickensoft.UMLGenerator/nupkg -type f -name "*.nupkg") | |
| echo "package=$package" >> "$GITHUB_OUTPUT" | |
| echo "📦 Found generator package: $package" | |
| - name: ✨ Create Release | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GH_BASIC_BASTANI }} | |
| run: | | |
| version="${{ steps.next-version.outputs.version }}" | |
| gh release create --title "v$version" --generate-notes "$version" \ | |
| "${{ steps.gen-package-path.outputs.package }}" | |
| - name: 🛜 Publish to Nuget | |
| run: | | |
| dotnet nuget push "${{ steps.gen-package-path.outputs.package }}" \ | |
| --api-key "${{ secrets.NUGET_API_KEY_BASTANI }}" \ | |
| --source "https://api.nuget.org/v3/index.json" --skip-duplicate |