-
Notifications
You must be signed in to change notification settings - Fork 0
Optimize and generalize releases #27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f6ee78c
optimize and generalize releases
alexlanz f4cda71
upgrade to checkout v5
alexlanz 1498b2f
extract version step to dedicated action
alexlanz baabf16
fix merge conflicts
alexlanz 22b9b75
add tagging as last step
alexlanz a2d4d78
fix wrong ordering
alexlanz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
| @@ -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 |
This file contains hidden or 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 |
|---|---|---|
| @@ -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 | ||
| 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 }}' | ||
This file was deleted.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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).