-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf944c5
commit b6bc95d
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 "(?<=<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 }} |