From ea6bc151b7fadd7d83eef49f0a9bf23083f54f79 Mon Sep 17 00:00:00 2001 From: jazzl0ver Date: Fri, 5 Dec 2025 10:58:00 +0300 Subject: [PATCH 1/4] Add GitHub Actions workflow for auto release --- .github/workflows/release.yml | 43 +++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1a1ec62 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,43 @@ +name: Auto Release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + + - name: Set up Amazon Corretto 11 + uses: actions/setup-java@v3 + with: + distribution: corretto + java-version: "11" + cache: maven + + - name: Build with Maven + run: mvn -B clean package + + - name: Create GitHub Release + id: create_release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Upload artifacts to release + uses: softprops/action-gh-release@v1 + with: + files: | + target/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 048792a3d51c93e4988347d58f7ef1060b2b0f7d Mon Sep 17 00:00:00 2001 From: jazzl0ver Date: Fri, 5 Dec 2025 11:25:52 +0300 Subject: [PATCH 2/4] Enable debug output for Maven build step --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a1ec62..005a71c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: cache: maven - name: Build with Maven - run: mvn -B clean package + run: mvn -B -X clean package - name: Create GitHub Release id: create_release From a214d259f8e9b6b9b4fc0d99beed0b822ad046cd Mon Sep 17 00:00:00 2001 From: jazzl0ver Date: Fri, 5 Dec 2025 12:38:12 +0300 Subject: [PATCH 3/4] Skip tests during Maven build in release workflow --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 005a71c..4f75955 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: cache: maven - name: Build with Maven - run: mvn -B -X clean package + run: mvn -B -X -DskipTests clean package - name: Create GitHub Release id: create_release From 2d24a83271549b54bc66f2e3c7d2f2a065b18fc4 Mon Sep 17 00:00:00 2001 From: jazzl0ver Date: Fri, 5 Dec 2025 13:04:37 +0300 Subject: [PATCH 4/4] Enhance release workflow to manage versioning Added steps to extract version from tag and update pom.xml. --- .github/workflows/release.yml | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4f75955..3f364e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,20 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 + - name: Extract version from tag + id: get_version + run: | + VERSION="${GITHUB_REF#refs/tags/v}" + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Show version + run: echo "Version is $VERSION" + + - name: Update version in pom.xml + run: | + mvn -q versions:set -DnewVersion="$VERSION" + mvn -q versions:commit + - name: Set up Amazon Corretto 11 uses: actions/setup-java@v3 with: @@ -20,23 +34,16 @@ jobs: java-version: "11" cache: maven - - name: Build with Maven - run: mvn -B -X -DskipTests clean package + - name: Build artifacts (without tests) + run: mvn -B -DskipTests clean package - name: Create GitHub Release - id: create_release uses: softprops/action-gh-release@v1 with: tag_name: ${{ github.ref_name }} name: Release ${{ github.ref_name }} draft: false prerelease: false - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Upload artifacts to release - uses: softprops/action-gh-release@v1 - with: files: | target/*.jar env: