Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c5c3541
ci: update workflow
mvallim Jul 22, 2025
1a3ce58
ci: update workflow
mvallim Jul 22, 2025
9f1ab16
ci: update workflow
mvallim Jul 22, 2025
b41738f
ci: update workflow
mvallim Jul 22, 2025
a7c2138
Merge pull request #81 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
c1d35d2
ci: update workflow
mvallim Jul 22, 2025
3d9fc7e
Merge branch 'develop' into feature/update-workflow
mvallim Jul 22, 2025
1cc3068
Merge pull request #83 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
8309ad8
Merge branch 'release/1.0.7' into develop
mvallim Jul 22, 2025
edda26c
Merge pull request #82 from mvallim/develop
mvallim Jul 22, 2025
b965916
ci: update workflow
mvallim Jul 22, 2025
fb7425e
ci: update workflow
mvallim Jul 22, 2025
ae31847
Merge pull request #86 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
f2ef62e
ci: update workflow
mvallim Jul 22, 2025
62f2716
ci: update workflow
mvallim Jul 22, 2025
efd7429
ci: update workflow
mvallim Jul 22, 2025
7ef0868
Merge pull request #87 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
5ec7b84
ci: update workflow
mvallim Jul 22, 2025
94c0bb8
Merge pull request #89 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
e95fc87
ci: update workflow
mvallim Jul 22, 2025
aaf9ecb
Merge pull request #90 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
758cd23
ci: update workflow
mvallim Jul 22, 2025
071a37c
ci: update workflow
mvallim Jul 22, 2025
75c4193
Merge pull request #92 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
5a993b2
ci: update workflow
mvallim Jul 22, 2025
9530141
Merge pull request #93 from mvallim/feature/update-workflow
mvallim Jul 22, 2025
334a963
Merge branch 'release/1.0.7' into develop
mvallim Jul 22, 2025
9d05f4e
Merge pull request #91 from mvallim/develop
mvallim Jul 22, 2025
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
59 changes: 59 additions & 0 deletions .github/workflows/cd-integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Build, Gates and Pull Request

on:
pull_request_target:
branches:
- develop
types:
- closed
- synchronize

permissions:
contents: write
pull-requests: write

jobs:
variables:
if: ${{ github.event.pull_request.merged == true }}
runs-on: ubuntu-latest
outputs:
version: ${{ steps.environment.outputs.version }}
target-branch: ${{ steps.environment.outputs.target-branch }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "corretto"
cache: "maven"

- id: environment
name: Set output environment passed to the reusable workflow
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout | cut -d '-' -f 1)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "target-branch=release/$VERSION" >> $GITHUB_OUTPUT

ci:
needs: variables
uses: ./.github/workflows/ci-maven.yml
secrets: inherit

gates:
needs: ci
if: success()
uses: ./.github/workflows/ci-gates.yml
secrets: inherit

pull-request:
needs: [gates, variables]
uses: ./.github/workflows/ci-pull-request.yml
secrets: inherit
with:
type: Snapshot
labels: automatic,snapshot
source-branch: master
target-branch: ${{ needs.variables.outputs.target-branch }}
25 changes: 25 additions & 0 deletions .github/workflows/cd-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build and Publish Release

on:
pull_request_target:
branches:
- master
types:
- closed

permissions:
contents: write
pull-requests: write

jobs:
ci:
if: ${{ github.event.pull_request.merged == true }}
uses: ./.github/workflows/ci-maven.yml
secrets: inherit

# release:
# needs: ci
# uses: ./.github/workflows/cd-deploy.yml
# secrets: inherit
# with:
# environment: release
36 changes: 36 additions & 0 deletions .github/workflows/cd-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Build, Publish Snapshot and Pull Request

on:
pull_request_target:
branches:
- release/**
types:
- closed
- synchronize

permissions:
contents: write
pull-requests: write

jobs:
ci:
if: ${{ github.event.pull_request.merged == true }}
uses: ./.github/workflows/ci-maven.yml
secrets: inherit

snapshot:
needs: ci
uses: ./.github/workflows/cd-deploy.yml
secrets: inherit
with:
environment: snapshot

pull-request:
needs: snapshot
uses: ./.github/workflows/ci-pull-request.yml
secrets: inherit
with:
type: Release
labels: automatic,release
source-branch: master
target-branch: master
64 changes: 0 additions & 64 deletions .github/workflows/cd.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/ci-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Create Pull Request
on:
workflow_call:
inputs:
source-branch:
description: Source branch
type: string
required: true
target-branch:
description: Target branch
type: string
Expand All @@ -23,9 +27,39 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v4

- name: Create branch
run: |
REPO="${{ github.repository }}"
BRANCH="${{ inputs.target-branch }}"
BASE="${{ inputs.source-branch }}"

echo "Checking if branch '$BRANCH' exists in repository '$REPO'..."

if gh api "repos/$REPO/branches/$BRANCH" --silent >/dev/null 2>&1; then
echo "Branch '$BRANCH' already exists."
else
echo "Branch '$BRANCH' does not exist. It will be created from '$BASE'."

BASE_SHA=$(gh api "repos/$REPO/git/ref/heads/$BASE" --jq .object.sha)

if [ -z "$BASE_SHA" ]; then
echo "Error: Could not retrieve the SHA of base branch '$BASE'"
exit 1
fi

gh api --method POST "repos/$REPO/git/refs" \
-f ref="refs/heads/$BRANCH" \
-f sha="$BASE_SHA"

echo "Branch '$BRANCH' successfully created!"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Pull Request (${{ inputs.type }})
uses: peter-evans/create-pull-request@v7
with:
title: Auto-created pull request into `${{ inputs.target-branch }}` from `${{ github.ref_name }}`
token: ${{ secrets.GITHUB_TOKEN }}
committer: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: ${{ github.actor }} <${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com>
Expand Down
52 changes: 31 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,61 @@ on:
branches:
- feature/**
- fix/**
paths-ignore:
- "**/README.md"
- "**/CONTRIBUTING.md"
- "**/CONTRIBUTORS.txt"
- "**/LICENSE"

env:
TYPE: ${{ startsWith(github.ref_name, 'feature') && 'Feature' || 'Fix'}}
LABELS: ${{ startsWith(github.ref_name, 'feature') && 'automatic,feature' || 'automatic,fix' }}
TARGET_BRANCH: develop

permissions:
contents: write
pull-requests: write

jobs:
set-outputs:
variables:
runs-on: ubuntu-latest
outputs:
type: ${{ steps.environment.outputs.type }}
labels: ${{ steps.environment.outputs.labels }}
target-branch: ${{ steps.environment.outputs.target-branch }}
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 17
distribution: "corretto"
cache: "maven"

- id: environment
name: Set output environment passed to the reusable workflow
run: |
VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "type=$TYPE" >> $GITHUB_OUTPUT
echo "labels=$LABELS" >> $GITHUB_OUTPUT
echo "target-branch=$TARGET_BRANCH" >> $GITHUB_OUTPUT
echo "target-branch=release/$VERSION" >> $GITHUB_OUTPUT

ci:
uses: ./.github/workflows/ci-maven.yml
secrets: inherit
# ci:
# needs: variables
# uses: ./.github/workflows/ci-maven.yml
# secrets: inherit

gates:
needs: ci
if: success()
uses: ./.github/workflows/ci-gates.yml
secrets: inherit
# gates:
# needs: ci
# if: success()
# uses: ./.github/workflows/ci-gates.yml
# secrets: inherit

pull-request:
needs: [gates, set-outputs]
# needs: [gates, variables]
needs: variables
if: success()
uses: ./.github/workflows/ci-pull-request.yml
secrets: inherit
with:
type: ${{ needs.set-outputs.outputs.type }}
labels: ${{ needs.set-outputs.outputs.labels }}
target-branch: ${{ needs.set-outputs.outputs.target-branch }}
type: ${{ needs.variables.outputs.type }}
labels: ${{ needs.variables.outputs.labels }}
source-branch: ${{ github.ref_name }}
target-branch: develop