Fix edge case behaviour for adding element. #196
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: Publish | |
| on: | |
| workflow_dispatch: | |
| push: | |
| paths-ignore: | |
| - '.gitignore' | |
| - 'LICENSE' | |
| - 'README.md' | |
| - 'gradle.yml' | |
| - "pictures/" | |
| - "Demo.zip" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/master' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Change wrapper permissions | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| run: chmod +x ./gradlew | |
| - uses: gradle/actions/wrapper-validation@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| distribution: 'temurin' | |
| java-version: 21 | |
| - name: Get previous build number | |
| id: getPreviousBuild | |
| run: | | |
| PREVIOUS_TAG=$(git for-each-ref --sort=-version:refname --count 1 --format="%(refname:short)" "refs/tags/*") | |
| echo result=${PREVIOUS_TAG} >> $GITHUB_OUTPUT | |
| - name: Get current build number | |
| id: getCurrentBuild | |
| if: success() | |
| env: | |
| PREVIOUS_BUILD: ${{ steps.getPreviousBuild.outputs.result }} | |
| run: echo result=$((++PREVIOUS_BUILD)) >> $GITHUB_OUTPUT | |
| - name: Build Project | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| run: ./gradlew launcher:shadowJar | |
| - name: Upload Artifacts to GitHub | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: Base | |
| path: launcher/build/libs/ | |
| if-no-files-found: error | |
| - name: Bump version and push tag | |
| id: tag_version | |
| uses: mathieudutour/[email protected] | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| tag_prefix: '' | |
| custom_tag: ${{ steps.getCurrentBuild.outputs.result }} | |
| - name: Generate release diff | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| env: | |
| BEGIN_COMMIT: ${{ steps.getPreviousBuild.outputs.result }} | |
| END_COMMIT: ${{ steps.getCurrentBuild.outputs.result }} | |
| run: git fetch --tags --force && git log --pretty=format:"* %s (%h)" ${BEGIN_COMMIT}..${END_COMMIT} > release_notes.md | |
| - name: Create release | |
| uses: ncipollo/release-action@v1 | |
| if: ${{ success() && github.ref_name == 'master' }} | |
| with: | |
| artifacts: "launcher/build/libs/Base.jar" | |
| allowUpdates: true | |
| bodyFile: "release_notes.md" | |
| draft: false | |
| prerelease: false | |
| name: Build ${{ steps.getCurrentBuild.outputs.result }} (${{ github.ref_name }}) | |
| tag: ${{ steps.getCurrentBuild.outputs.result }} | |
| token: ${{ secrets.GITHUB_TOKEN }} |