This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
distribution: "temurin" # Specify the JDK distribution (e.g., 'temurin', 'adopt', etc.) | |
- name: Build with Maven | |
run: mvn clean package | |
- name: Get version from pom.xml | |
id: get_version | |
run: | | |
VERSION=$(grep -oPm1 "(?<=<version>)[^<]+" 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 }} |