Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
name: Test
name: Main

on:
pull_request:
types: [ opened, reopened, synchronize ]
on: push

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
test:
name: Tests
uses: ./.github/workflows/test.yml
runs-on: ubuntu-24.04
timeout-minutes: 10
steps:
- uses: actions/checkout@v5
- uses: aboutbits/github-actions-java/setup-with-maven@v4
with:
java-version: 21
- name: Test
env:
GITHUB_USER_NAME: ${{ github.actor }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
./mvnw
-s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml
--batch-mode
--fail-fast
-Dsurefire.failIfNoSpecifiedTests=false
test
shell: bash
56 changes: 25 additions & 31 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,43 @@
name: Publish package to GitHub Packages
name: Release Package

on:
workflow_dispatch:
inputs:
version:
description: "Version name to publish (eg: x.x.x)"
description: "Version (eg: x.x.x)"
type: string
required: true

jobs:
publish:
timeout-minutes: 15
build-and-publish:
runs-on: ubuntu-24.04
timeout-minutes: 15
permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@v4

- uses: aboutbits/github-actions-java/setup@v3

- name: Set Version
run: sed -i 's|<version>BUILD-SNAPSHOT</version>|<version>${{ github.event.inputs.version }}</version>|g' pom.xml

- uses: actions/checkout@v5
with:
token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
- uses: aboutbits/github-actions-base/git-setup@v2
- uses: aboutbits/github-actions-java/setup-with-maven@v4
with:
java-version: 21
- uses: aboutbits/github-actions-java/set-version-with-maven@v4
with:
version: "${{ github.event.inputs.version }}"
- uses: aboutbits/github-actions-base/git-commit-and-push-all@v2
with:
message: '${{ github.event.inputs.version }}'
- uses: aboutbits/github-actions-base/git-create-or-update-tag@v2

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this would be redundant because the github release will also create the tag if necessary.
Also this would add the tag before publishing the package (which might still fail).

with:
tag-name: 'v${{ github.event.inputs.version }}'
- name: Publish package
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml --batch-mode deploy
env:
GITHUB_USER_NAME: ${{ github.actor }}
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}

release:
timeout-minutes: 5
runs-on: ubuntu-24.04
needs: publish
steps:
- uses: actions/checkout@v4

- name: Create GitHub release
uses: actions/github-script@v7
run: mvn -s $GITHUB_WORKSPACE/.github/workflows/maven-settings.xml --batch-mode deploy
shell: bash
- uses: aboutbits/github-actions-base/github-create-release@v2
with:
script: |
github.rest.repos.createRelease({
owner: context.repo.owner,
repo: context.repo.repo,
tag_name: 'v${{ github.event.inputs.version }}',
name: 'v${{ github.event.inputs.version }}',
prerelease: '${{ github.event.inputs.version }}'.includes('RC')
})
tag-name: 'v${{ github.event.inputs.version }}'
25 changes: 0 additions & 25 deletions .github/workflows/test.yml

This file was deleted.