From 094fe14adf13aeea7354ccd76af5cf2892521b24 Mon Sep 17 00:00:00 2001 From: Paul Wagner Date: Fri, 15 Nov 2024 20:56:34 +0100 Subject: [PATCH] Add release-tag workflow --- .github/workflows/build.yml | 3 +++ .github/workflows/release_tag.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .github/workflows/release_tag.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 448951a..2fbc0ad 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,7 @@ name: Build on: + workflow_call: push: branches: - main @@ -21,6 +22,8 @@ jobs: with: distribution: 'zulu' java-version: '18' + cache: gradle + - name: Build with Gradle run: ./gradlew jar \ No newline at end of file diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml new file mode 100644 index 0000000..6c6ebec --- /dev/null +++ b/.github/workflows/release_tag.yml @@ -0,0 +1,29 @@ +name: Release Tag + +on: + push: + tags: + - v* + +permissions: + contents: write + +jobs: + build: + uses: ./.github/workflows/build.yml + release-tag: + name: Release Tag + runs-on: ubuntu-22.04 + steps: + - name: Checkout repository + uses: actions/checkout@v2 + - name: Build + uses: ./.github/workflows/build + - name: Create release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref_name }} + run: | + gh release create "$tag" build/libs/model-checking-1.0-SNAPSHOT.jar \ + --repo="$GITHUB_REPOSITORY" \ + --title="v${tag#v}" \ No newline at end of file