From 2f1fa18419012cbf3778ed8451db3ef48b3c7ab3 Mon Sep 17 00:00:00 2001 From: Federico Date: Sat, 4 May 2024 12:11:50 +0200 Subject: [PATCH] Vaffanculo merge --- .github/workflows/gradle.yml | 48 ++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/gradle.yml diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 0000000..319f32b --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,48 @@ +name: Create release + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: actions/cache@v3 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: | + ${{ runner.os }}-gradle- + + - uses: actions/cache@v3 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradlew-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradlew- + + - name: Retrieve current version number before release + run: sh gradlew printVersion + + - name: Create release tag + id: createRelease + run: | + sh gradlew shadowJar releaseVersion --no-commit + + - name: Push new tag + run: | + git push origin --tags + + - name: Create GitHub release + env: + GITHUB_TOKEN: ${{ github.token }} + run: | + version=v$(sh gradlew -q printVersion) + tag=$(git describe --tags --abbrev=0) + sh gradlew -q printChangeLog | gh release create $tag --latest -t "$version" -F - ${{ github.workspace }}/plugin/build/libs/*.jar ${{ github.workspace }}/api/build/libs/*.jar