From 282088ef9f120dda36c91f01e272102ae22fe7e2 Mon Sep 17 00:00:00 2001 From: dblock Date: Thu, 29 Feb 2024 16:53:05 -0500 Subject: [PATCH] Added snapshot and tagged release workflows. Signed-off-by: dblock --- .github/workflows/release.yml | 34 +++++++++++++++++++++++++++ .github/workflows/snapshot.yml | 42 ++++++++++++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/snapshot.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..85a8325 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,34 @@ +--- +name: Publish Release + +on: + push: + tags: + - "v*" + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: write-all + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + + - name: Build and Run Tests + run: | + ./gradlew build + ./gradlew publishPluginZipPublicationToZipStagingRepository -Dbuild.snapshot=false + + - uses: marvinpinto/action-automatic-releases@v1.2.1 + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + prerelease: false + files: | + LICENSE.txt + build/distributions/* \ No newline at end of file diff --git a/.github/workflows/snapshot.yml b/.github/workflows/snapshot.yml new file mode 100644 index 0000000..90a31da --- /dev/null +++ b/.github/workflows/snapshot.yml @@ -0,0 +1,42 @@ +--- +name: Publish Snapshot + +on: + push: + branches: + - main + - 2.x + +jobs: + snapshot: + name: Snapshot + runs-on: ubuntu-latest + permissions: write-all + + steps: + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: 11 + distribution: temurin + + - name: Build and Run Tests + run: | + ./gradlew build + ./gradlew publishPluginZipPublicationToZipStagingRepository + + - name: Extract Branch Name + id: branch + shell: bash + run: echo "name=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" >> $GITHUB_OUTPUT + + - uses: marvinpinto/action-automatic-releases@v1.2.1 + with: + repo_token: "${{ secrets.GITHUB_TOKEN }}" + automatic_release_tag: latest + prerelease: true + title: Development Build (${{ steps.branch.outputs.name }}) + files: | + LICENSE.txt + build/distributions/* \ No newline at end of file