Build and Release #8
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 and Release | |
| on: | |
| workflow_dispatch: | |
| env: | |
| FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up JDK 25 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '25' | |
| distribution: 'temurin' | |
| - name: Setup Gradle | |
| uses: gradle/actions/setup-gradle@v6 | |
| - name: Make gradlew executable | |
| run: chmod +x gradlew | |
| - name: Apply Spotless Formatting | |
| run: ./gradlew spotlessApply --no-daemon | |
| - name: Build with Gradle | |
| run: ./gradlew :velocity-proxy:shadowJar --no-daemon | |
| - name: Parse Version | |
| id: parse_version | |
| run: | | |
| # Read version from gradle.properties | |
| FULL_VERSION=$(grep "^version=" gradle.properties | cut -d'=' -f2) | |
| # Extract only the part before parenthesis for the release name | |
| CLEAN_VERSION=$(echo "$FULL_VERSION" | sed 's/(.*)//') | |
| echo "FULL_VERSION=$FULL_VERSION" >> $GITHUB_ENV | |
| echo "CLEAN_VERSION=$CLEAN_VERSION" >> $GITHUB_ENV | |
| - name: Rename Release Jar | |
| run: | | |
| mv "proxy/build/libs/CleanVelocity-${{ env.FULL_VERSION }}-all.jar" "proxy/build/libs/CleanVelocity-${{ env.CLEAN_VERSION }}.jar" | |
| - name: Create or Update Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ env.FULL_VERSION }} | |
| name: Release ${{ env.CLEAN_VERSION }} | |
| body: | | |
| **Full Changelog**: | |
| Requires Java 25 or higher. | |
| Velocity API - 4.1.0-SNAPSHOT | |
| draft: false | |
| prerelease: false | |
| files: proxy/build/libs/CleanVelocity-${{ env.CLEAN_VERSION }}.jar | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |