From 33136d317214c2f359cdf8b0825df695667915f0 Mon Sep 17 00:00:00 2001 From: blagazsolt <79199834+blagazsolt@users.noreply.github.com> Date: Fri, 25 Nov 2022 14:04:33 +0100 Subject: [PATCH] Create CD-create_release.yml --- .github/workflows/CD-create_release.yml | 53 +++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/CD-create_release.yml diff --git a/.github/workflows/CD-create_release.yml b/.github/workflows/CD-create_release.yml new file mode 100644 index 0000000000..6098d52864 --- /dev/null +++ b/.github/workflows/CD-create_release.yml @@ -0,0 +1,53 @@ +name: Create release file +'on': + workflow_dispatch: null +jobs: + gradle: + name: Run Gradle + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: temurin + java-version: 17 + - name: Setup and execute Gradle 'build' task + uses: gradle/gradle-build-action@v2 + id: build + with: + arguments: build --scan + - run: 'echo "${{steps.build.outputs.build}}"' + - uses: actions/upload-artifact@v3 + with: + name: ThetaJars + path: subprojects/**/*-all.jar + publish: + name: Publish Release + needs: gradle + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Creating version number + run: >- + echo "version=$(grep "version" build.gradle.kts | tail -n 1 | cut -d + "=" -f2 | xargs echo )" >> $GITHUB_OUTPUT + id: value + shell: bash + - run: 'echo "${{steps.value.outputs.version}}"' + - uses: actions/download-artifact@v3 + with: + name: ThetaJars + path: jar/ + - name: Display structure of downloaded files + run: ls -R + - run: find jar + - run: for i in $(find jar -name "*-all.jar"); do mv $i jar/$(basename ${i%-${{steps.value.outputs.version}}-all.jar}.jar); done + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: jar/**/*.jar + body: "Auto-generated release" + name: ${{steps.value.outputs.version}} + tag_name: ${{steps.value.outputs.version}} +