diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 928c51b..62316a2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -30,6 +30,25 @@ jobs: - name: Test with Maven run: mvn -B --update-snapshots clean test + tag: + if: github.repository == 'refs/heads/main' + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Set up JDK 1.8 + uses: actions/setup-java@v3 + with: + java-version: '8' + distribution: 'corretto' + cache: maven + - name: Create Release + run: | + VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) + echo "Creating release for version $VERSION" + git tag -a "v$VERSION" -m "Release $VERSION" + git push origin "$VERSION" + publish: if: github.repository == 'refs/heads/main' runs-on: ubuntu-latest