Skip to content

Commit

Permalink
Define separate workflows for build and release
Browse files Browse the repository at this point in the history
  • Loading branch information
Dario Mauri committed May 4, 2024
1 parent feaaaa2 commit 92eb520
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test and Package
name: Build workflow

on: [ push, pull_request ]

Expand All @@ -21,7 +21,5 @@ jobs:
server-id: github
settings-path: ${{ github.workspace }}

- name: Publish to GitHub Packages
run: mvn --batch-mode deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run tests
run: mvn --batch-mode test
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release workflow

on:
release:
types: [ created ]

jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
cache: 'maven'
server-id: github
settings-path: ${{ github.workspace }}

- name: Publish to GitHub Packages
run: mvn --batch-mode -s $GITHUB_WORKSPACE/settings.xml deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 92eb520

Please sign in to comment.