Create Release #20
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: Create Release | |
| on: | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| name: Build ShadowJars and Create Release | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| ref: develop # Ensure it works from the develop branch | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v3 | |
| with: | |
| distribution: 'adopt' | |
| java-version: '21' | |
| - name: Cache Gradle packages | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.gradle/caches | |
| ~/.gradle/wrapper | |
| key: gradle-${{ runner.os }}-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} | |
| restore-keys: | | |
| gradle-${{ runner.os }} | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Get Gradle Version | |
| id: gradle_version | |
| run: echo "GRADLE_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}')" >> $GITHUB_ENV | |
| - name: Get Commit Hash | |
| id: commit_hash | |
| run: echo "COMMIT_HASH=$(git rev-parse --short HEAD)" >> $GITHUB_ENV | |
| - name: Publish to SimpleCloud Repository | |
| run: ./gradlew publishMavenJavaPublicationToSimplecloudRepository | |
| env: | |
| COMMIT_HASH: ${{ env.COMMIT_HASH }} | |
| SIMPLECLOUD_USERNAME: ${{ secrets.SIMPLECLOUD_USERNAME }} | |
| SIMPLECLOUD_PASSWORD: ${{ secrets.SIMPLECLOUD_PASSWORD }} | |
| - name: Create Release | |
| id: create_release | |
| uses: actions/create-release@v1 | |
| with: | |
| tag_name: v${{ env.GRADLE_VERSION }}-dev.${{ env.COMMIT_HASH }} | |
| release_name: v${{ env.GRADLE_VERSION }}-dev.${{ env.COMMIT_HASH }} | |
| draft: false | |
| prerelease: true | |
| commitish: develop | |
| body: | | |
| This release contains dev builds for all Gradle modules. | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |