feat: improve registerEvent to allow event params to be provided to the function
#92
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: | |
| - master | |
| pull_request: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Validate Gradle Wrapper | |
| uses: gradle/actions/wrapper-validation@v4 | |
| - name: Setup JDK | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'microsoft' | |
| - name: Make Gradle Wrapper Executable | |
| run: chmod +x ./gradlew | |
| - name: Build Jar | |
| run: ./gradlew build | |
| - name: Capture Build Artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: mod-jar | |
| path: build/libs/*.jar | |
| - name: Read gradle.properties Release Flags | |
| id: release_props | |
| if: github.event_name == 'push' && github.ref == 'refs/heads/master' | |
| run: | | |
| SHOULD_RELEASE=$(grep -Po '^shouldRelease=.*' gradle.properties | cut -d= -f2 | xargs) | |
| if [ "$SHOULD_RELEASE" != "true" ]; then | |
| echo "shouldRelease is false — skipping release" | |
| exit 0 | |
| fi | |
| MOD_VERSION=$(grep -Po '^modVersion=.*' gradle.properties | cut -d= -f2 | xargs) | |
| echo "SHOULD_RELEASE=$SHOULD_RELEASE" >> $GITHUB_OUTPUT | |
| echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT | |
| echo "MOD_VERSION=$MOD_VERSION" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| if: steps.release_props.outputs.SHOULD_RELEASE == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.release_props.outputs.MOD_VERSION }}.${{ steps.release_props.outputs.SHA_SHORT }} | |
| name: Cobalt v${{ steps.release_props.outputs.MOD_VERSION }} | |
| files: build/libs/*.jar | |
| body: ${{ github.event.head_commit.message }} | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} |