Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
cosad3s committed Jul 25, 2024
2 parents 8142ad8 + fdd0ec4 commit 662c709
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
# This workflow will build a package using Maven and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#apache-maven-with-a-settings-path

name: Maven Package
name: Maven Package - Trigger

on:
workflow_dispatch:
release:
types: [created]

jobs:
build:
Expand All @@ -18,13 +13,15 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: develop
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
server-id: github
settings-path: ${{ github.workspace }}

- name: Build with Maven
run: mvn -B package --file pom.xml
Expand Down
51 changes: 51 additions & 0 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Maven Package and Release

on:
push:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: write
actions: write
repository-projects: write
packages: write

steps:
- uses: actions/checkout@v4
with:
ref: main
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github
settings-path: ${{ github.workspace }}

- name: Maven Release x GitHub Packages
run: |
git config --global user.name "cosad3s - Github Actions"
git config --global user.email "[email protected]"
mvn release:prepare --batch-mode
mvn release:perform -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Get the new tag
id: get_tag
run: echo "::set-output name=tag::$(git describe --tags $(git rev-list --tags --max-count=1))"

- name: Create the release
uses: softprops/action-gh-release@v2
with:
name: Release ${{ steps.get_tag.outputs.tag }}
tag_name: ${{ steps.get_tag.outputs.tag }}
files: |
target/salsa-jar-with-dependencies.jar
make_latest: true
token: ${{ github.token }}

0 comments on commit 662c709

Please sign in to comment.