diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..3f364e5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Auto Release + +on: + push: + tags: + - "v*" + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - 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: + distribution: corretto + java-version: "11" + cache: maven + + - name: Build artifacts (without tests) + run: mvn -B -DskipTests clean package + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ github.ref_name }} + name: Release ${{ github.ref_name }} + draft: false + prerelease: false + files: | + target/*.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}