From b6bc95d25b6b4c199aa27a53948b3dc51382aba6 Mon Sep 17 00:00:00 2001 From: Martin Kubicki Date: Fri, 2 Aug 2024 13:53:37 +0200 Subject: [PATCH] Add release workflow --- .github/workflows/release.yaml | 39 ++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..4090834 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,39 @@ +name: Build and Release + +on: + push: + branches: + - main # Change this to your default branch if it's not 'main' + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Set up JDK + uses: actions/setup-java@v2 + with: + java-version: '11' # Change this to your required Java version + + - name: Build with Maven + run: mvn clean package + + - name: Get version from pom.xml + id: get_version + run: | + VERSION=$(grep -oPm1 "(?<=)[^<]+" pom.xml) + echo "VERSION=$VERSION" >> $GITHUB_ENV + + - name: Create GitHub Release + uses: softprops/action-gh-release@v1 + with: + tag_name: ${{ env.VERSION }} + release_name: Release ${{ env.VERSION }} + body: | + This release includes the JAR file built from the latest commit. + files: target/mateo-screenshot-tool.jar + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file