Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
9fb2e65
replace circleci config with gha config
assadriaz Dec 27, 2024
a13344a
update workflow add xmlstartlet
assadriaz Dec 27, 2024
d8e453c
update workflow add xmlstartlet
assadriaz Dec 27, 2024
008579e
update workflow to use jrealser to release to maven central
assadriaz Jan 19, 2026
196cb8a
Configure GitHub Actions
vpaturet Dec 11, 2024
0d1fcb1
Update all non-major dependencies (#210)
renovate[bot] Jan 13, 2025
6cad0d3
Update dependency org.assertj:assertj-core from v3.27.2 to v3.27.3 (#…
renovate[bot] Jan 27, 2025
3b04928
Update dependency org.apache.maven.plugins:maven-clean-plugin from v3…
renovate[bot] Feb 24, 2025
1358c3d
Update all non-major dependencies (#215)
renovate[bot] Feb 24, 2025
e03d73a
Update all non-major dependencies (#216)
renovate[bot] Mar 3, 2025
ecfdc28
Update all non-major dependencies from v5.12.0 to v5.12.1 (#217)
renovate[bot] Mar 17, 2025
c2bf3d5
Update dependency org.apache.maven.plugins:maven-surefire-plugin from…
renovate[bot] Mar 31, 2025
fc8fe19
Update dependency org.sonarsource.scanner.maven:sonar-maven-plugin fr…
renovate[bot] Mar 31, 2025
f2ff23a
Update dependency org.jacoco:jacoco-maven-plugin from v0.8.12 to v0.8…
renovate[bot] Apr 7, 2025
e5f05bf
Update all non-major dependencies from v5.12.1 to v5.12.2 (#221)
renovate[bot] Apr 14, 2025
c40395e
Update dependency io.github.git-commit-id:git-commit-id-maven-plugin …
renovate[bot] May 26, 2025
6ff48ba
Update dependency org.codehaus.mojo:exec-maven-plugin from v3.5.0 to …
renovate[bot] Jun 2, 2025
a6d5d1d
Update all non-major dependencies (#225)
renovate[bot] Jun 2, 2025
f9079e5
Replace status badge in README.md (#222)
testower Jun 2, 2025
0fb3355
Configure deploy to Artifactory (#229)
vpaturet Jun 4, 2025
91bbf62
Use temurin build image
vpaturet Jun 4, 2025
2e040b7
Synchronize DatedServiceJourney with CEN version (#144)
vpaturet Jun 4, 2025
26f0eba
Update all non-major dependencies from v5.13.0 to v5.13.1 (#231)
renovate[bot] Jun 9, 2025
55fc383
Update all non-major dependencies from v5.13.1 to v5.13.2 (#232)
renovate[bot] Jun 30, 2025
e15cfe8
Update all non-major dependencies from v5.13.2 to v5.13.3 (#233)
renovate[bot] Jul 7, 2025
f33f351
Update dependency org.apache.maven.plugins:maven-enforcer-plugin from…
renovate[bot] Jul 7, 2025
b57d7aa
Update dependency org.apache.commons:commons-lang3 from v3.17.0 to v3…
renovate[bot] Jul 12, 2025
7f3da4e
Update all non-major dependencies (#237)
renovate[bot] Jul 28, 2025
6afb6f5
Update dependency org.assertj:assertj-core from v3.27.3 to v3.27.4 (#…
renovate[bot] Aug 11, 2025
59e9a29
Update dependency org.apache.maven.plugins:maven-javadoc-plugin from …
renovate[bot] Aug 18, 2025
98f1663
Update dependency org.sonarsource.scanner.maven:sonar-maven-plugin fr…
renovate[bot] Sep 1, 2025
547f41c
Update dependency org.apache.maven.plugins:maven-surefire-plugin from…
renovate[bot] Sep 15, 2025
535d075
Update dependency org.apache.maven.plugins:maven-javadoc-plugin from …
renovate[bot] Sep 22, 2025
83da605
Update all non-major dependencies (#244)
renovate[bot] Sep 22, 2025
1d74440
Update all non-major dependencies (#246)
renovate[bot] Sep 29, 2025
7ff9664
Update all non-major dependencies (#247)
renovate[bot] Sep 29, 2025
60894e7
Update dependency org.apache.maven.plugins:maven-enforcer-plugin from…
renovate[bot] Oct 6, 2025
617cba9
Update all non-major dependencies (#249)
renovate[bot] Oct 6, 2025
f13f6f7
Update dependency org.jacoco:jacoco-maven-plugin from v0.8.13 to v0.8…
renovate[bot] Oct 13, 2025
dbca7e2
Update dependency org.codehaus.mojo:exec-maven-plugin from v3.6.1 to …
renovate[bot] Oct 20, 2025
6151541
Update all non-major dependencies from v4.1.0 to v4.1.1 (#253)
renovate[bot] Oct 27, 2025
0219e74
Update all non-major dependencies from v5.14.0 to v5.14.1 (#254)
renovate[bot] Nov 10, 2025
8255434
Update all non-major dependencies (#255)
renovate[bot] Nov 10, 2025
0784896
Update all non-major dependencies (#256)
renovate[bot] Nov 17, 2025
ba35267
Update dependency org.codehaus.plexus:plexus-compiler-javac from v2.1…
renovate[bot] Nov 24, 2025
6591672
Update all non-major dependencies (#259)
renovate[bot] Dec 15, 2025
5cb5d63
Update dependency org.codehaus.mojo:exec-maven-plugin from v3.6.2 to …
renovate[bot] Jan 5, 2026
66cc3ee
Update all non-major dependencies from v5.14.1 to v5.14.2 (#262)
renovate[bot] Jan 12, 2026
6fbbf32
replace circleci config with gha config
assadriaz Dec 27, 2024
1fceca0
update workflow to use jrealser to release to maven central
assadriaz Jan 19, 2026
b3e1780
Merge branch 'master' into gha-migration
assadriaz Jan 19, 2026
d6af267
update workflows
assadriaz Jan 19, 2026
9884d74
update deploy.yml
assadriaz Jan 19, 2026
3376e77
update deploy.yml, use java 17
assadriaz Jan 19, 2026
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
80 changes: 80 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
name: Build and Deploy
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
maven-verify:
runs-on: ubuntu-24.04
outputs:
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install xmlstarlet
run: |
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get -y install xmlstarlet
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: liberica
- name: Cache Maven dependencies
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
${{ runner.os }}-maven-
${{ runner.os }}-

- name: Get version from pom.xml
id: get-version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Detected version: $VERSION"

- name: Run maven build
run: mvn package

- name: Sonar Scan
env:
SONAR_TOKEN: ${{ secrets.ENTUR_SONAR_PASSWORD }}
SONAR_PROJECT_NAME: ${{ github.event.repository.name }}
SONAR_PROJECT_KEY: entur_${{ github.event.repository.name }}
run: |
mvn -Psonar org.jacoco:jacoco-maven-plugin:prepare-agent verify \
org.jacoco:jacoco-maven-plugin:report sonar:sonar \
-Dmaven.main.skip \
-DskipTests \
-Dsonar.projectKey=${SONAR_PROJECT_KEY} \
-Dsonar.organization=enturas-github \
-Dsonar.projectName=${SONAR_PROJECT_NAME} \
-Dsonar.host.url=https://sonarcloud.io \
-Dsonar.token=${SONAR_TOKEN}

- name: Upload artifact
uses: actions/upload-artifact@v4.4.3
with:
name: build-artifacts
path: target/*.jar

publish-snapshot:
name: Publish snapshot to Maven Central
if: github.repository_owner == 'entur' && github.event_name == 'push' && github.ref == 'refs/heads/master'
needs: maven-verify
uses: ./.github/workflows/maven-jreleaser-release.yml
with:
version: ${{ needs.maven-verify.outputs.version }}
snapshot: true
skip_version_update: true
java_version: 11
java_distribution: liberica
secrets: inherit
248 changes: 248 additions & 0 deletions .github/workflows/gitflow-hotfix-finish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,248 @@
name: Hotfix Finish (Gitflow)

on:
workflow_call:
inputs:
hotfix_branch:
description: 'Hotfix branch to finish (e.g., hotfix/2.0.16.1)'
required: true
type: string
merge_to_main:
description: 'Cherry-pick hotfix commits to base branch'
required: false
type: boolean
default: true
runner:
description: 'Runner to use for jobs'
required: false
type: string
default: "ubuntu-24.04"
java_version:
description: 'Java version to use'
required: false
type: number
default: 21
java_distribution:
description: 'Java distribution to use'
required: false
type: string
default: "liberica"
version_tag_prefix:
description: 'Prefix for version tags'
required: false
type: string
default: "v"
artifact_group_id:
description: 'Maven group ID for summary links (e.g., io.entur)'
required: false
type: string
default: ""
artifact_ids:
description: 'Comma-separated artifact IDs for summary links (e.g., my-library,my-cli)'
required: false
type: string
default: ""
base_branch:
description: 'Base branch to cherry-pick changes to (e.g., main, master, develop)'
required: false
type: string
default: "main"
secrets:
SONATYPE_AUTH_USER:
required: true
SONATYPE_AUTH_TOKEN:
required: true
SONATYPE_GPG_KEY_PUBLIC:
required: true
SONATYPE_GPG_KEY:
required: true
SONATYPE_GPG_KEY_PASSWORD:
required: true

jobs:
get-hotfix-version:
runs-on: ${{ inputs.runner || 'ubuntu-24.04' }}
outputs:
version: ${{ steps.get_version.outputs.version }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.hotfix_branch }}
fetch-depth: 0

- uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version || 21 }}
distribution: ${{ inputs.java_distribution || 'liberica' }}

- name: Get hotfix version
id: get_version
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
# Remove -SNAPSHOT if present
VERSION="${VERSION%-SNAPSHOT}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Hotfix version: $VERSION"

create-tag:
name: Create hotfix tag
needs: get-hotfix-version
runs-on: ${{ inputs.runner || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.hotfix_branch }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Create and push tag
run: |
VERSION="${{ needs.get-hotfix-version.outputs.version }}"
TAG="${{ inputs.version_tag_prefix || 'v' }}${VERSION}"

echo "Creating tag: $TAG from branch ${{ inputs.hotfix_branch }}"
git tag -a "$TAG" -m "Hotfix $VERSION"
git push origin "$TAG"

publish-hotfix:
name: Publish to Maven Central
needs: [get-hotfix-version, create-tag]
runs-on: ${{ inputs.runner || 'ubuntu-24.04' }}
env:
JRELEASER_MAVENCENTRAL_URL: "https://central.sonatype.com/api/v1/publisher"
JRELEASER_DEPLOY_MAVEN_MAVENCENTRAL_ACTIVE: "RELEASE"
JRELEASER_DEPLOY_MAVEN_NEXUS2_ACTIVE: "SNAPSHOT"
JRELEASER_NEXUS2_URL: "https://ossrh-staging-api.central.sonatype.com/service/local"
JRELEASER_NEXUS2_SNAPSHOT_URL: "https://central.sonatype.com/repository/maven-snapshots"
JRELEASER_OVERWRITE: true
JRELEASER_UPDATE: true
JRELEASER_GIT_ROOT_SEARCH: true
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.version_tag_prefix || 'v' }}${{ needs.get-hotfix-version.outputs.version }}
fetch-depth: 0

- uses: actions/setup-java@v4
with:
java-version: ${{ inputs.java_version || 21 }}
distribution: ${{ inputs.java_distribution || 'liberica' }}
cache: maven

- name: Install xmlstarlet
run: |
sudo rm -rf /var/lib/apt/lists/*
sudo apt-get update
sudo apt-get -y install xmlstarlet

- name: JReleaser Release to Maven Central
uses: entur/gha-maven-central/.github/actions/jreleaser-release@v1
with:
version: ${{ needs.get-hotfix-version.outputs.version }}
version_tag_prefix: ${{ inputs.version_tag_prefix || 'v' }}
github_token: ${{ secrets.GITHUB_TOKEN }}
sonatype_username: ${{ secrets.SONATYPE_AUTH_USER }}
sonatype_password: ${{ secrets.SONATYPE_AUTH_TOKEN }}
gpg_public_key: ${{ secrets.SONATYPE_GPG_KEY_PUBLIC }}
gpg_secret_key: ${{ secrets.SONATYPE_GPG_KEY }}
gpg_passphrase: ${{ secrets.SONATYPE_GPG_KEY_PASSWORD }}
artifactory_user: ${{ secrets.ARTIFACTORY_AUTH_USER }}
artifactory_token: ${{ secrets.ARTIFACTORY_AUTH_TOKEN }}

- name: Upload Build Reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: jreleaser-reports
path: |
**/target/site
**/target/reports/
**/target/surefire-reports

merge-to-base-branch:
name: Cherry-pick hotfix to base branch
needs: [get-hotfix-version, publish-hotfix]
if: inputs.merge_to_main == true
runs-on: ${{ inputs.runner || 'ubuntu-24.04' }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.base_branch || 'main' }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"

- name: Cherry-pick hotfix commits
run: |
HOTFIX_BRANCH="${{ inputs.hotfix_branch }}"
BASE_BRANCH="${{ inputs.base_branch || 'main' }}"
echo "Cherry-picking commits from $HOTFIX_BRANCH to $BASE_BRANCH"

# Get the base commit (where hotfix branched from)
git fetch origin "$HOTFIX_BRANCH"

# Find all commits in the hotfix branch
HOTFIX_COMMITS=$(git log --reverse --pretty=format:"%H" origin/$HOTFIX_BRANCH --not $(git merge-base origin/$BASE_BRANCH origin/$HOTFIX_BRANCH))

# Cherry-pick each commit
for commit in $HOTFIX_COMMITS; do
echo "Cherry-picking commit: $commit"
git cherry-pick "$commit" || {
echo "::warning::Cherry-pick conflict on commit $commit. Resolve manually."
git cherry-pick --abort
exit 1
}
done

- name: Push to base branch
run: |
BASE_BRANCH="${{ inputs.base_branch || 'main' }}"
git push origin "$BASE_BRANCH"

- name: Delete hotfix branch
continue-on-error: true
run: |
HOTFIX_BRANCH="${{ inputs.hotfix_branch }}"
echo "Deleting hotfix branch: $HOTFIX_BRANCH"
git push origin --delete "$HOTFIX_BRANCH" || echo "Branch already deleted"

- name: Create summary
run: |
VERSION="${{ needs.get-hotfix-version.outputs.version }}"
TAG_PREFIX="${{ inputs.version_tag_prefix || 'v' }}"
GROUP_ID="${{ inputs.artifact_group_id }}"
ARTIFACT_IDS="${{ inputs.artifact_ids }}"

cat >> $GITHUB_STEP_SUMMARY <<EOF
## Hotfix Released

- **Hotfix Version:** $VERSION
- **Git Tag:** \`${TAG_PREFIX}${VERSION}\`
EOF

# Add Maven Central links if artifact details are provided
if [ -n "$GROUP_ID" ] && [ -n "$ARTIFACT_IDS" ]; then
IFS=',' read -ra ARTIFACTS <<< "$ARTIFACT_IDS"
for ARTIFACT_ID in "${ARTIFACTS[@]}"; do
ARTIFACT_ID=$(echo "$ARTIFACT_ID" | xargs) # Trim whitespace
echo "- **Maven Central ($ARTIFACT_ID):** https://central.sonatype.com/artifact/${GROUP_ID}/${ARTIFACT_ID}/${VERSION}" >> $GITHUB_STEP_SUMMARY
done
fi

BASE_BRANCH="${{ inputs.base_branch || 'main' }}"

cat >> $GITHUB_STEP_SUMMARY <<EOF
- **Hotfix Branch:** Deleted
- **Merged to $BASE_BRANCH:** ${{ inputs.merge_to_main }}

The hotfix has been published to Maven Central.
EOF
Loading