Skip to content
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

Update release-please.yml #284

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Changes from all 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
20 changes: 8 additions & 12 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,48 +15,44 @@ name: release-please
jobs:
release_please:
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release.outputs.release_created }}
steps:
- uses: google-github-actions/release-please-action@v3
id: release
with:
release-type: maven
package-name: compas-core
# The logic below handles the github packages publication:
publish:
needs: release_please
if: needs.release_please.outputs.release_created == "true"
name: Build and publish
runs-on: ubuntu-latest
timeout-minutes: 15

steps:
- name: Checkout

- if: ${{ steps.release.outputs.release_created }}
name: Checkout
uses: actions/checkout@v4

- name: Extract tag name
if: ${{ steps.release.outputs.release_created }}
id: extract_tagname
shell: bash
# Extract the tag name from the git reference, value of GITHUB_REF will be something like refs/tags/<tag_name>.
run: echo "##[set-output name=tagname;]$(echo ${GITHUB_REF##*/})"

- name: Set up JDK 17
uses: actions/setup-java@v3
if: ${{ steps.release.outputs.release_created }}
with:
distribution: 'zulu'
java-version: '17'

- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v21
if: ${{ steps.release.outputs.release_created }}
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Set version with Maven
if: ${{ steps.release.outputs.release_created }}
run: ./mvnw -B versions:set -DprocessAllModules=true -DnewVersion=${{ steps.extract_tagname.outputs.tagname }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Deploy with Maven to GitHub Packages
if: ${{ steps.release.outputs.release_created }}
run: ./mvnw -B -s custom_maven_settings.xml -Prelease clean deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}