Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI Build

on:
push:
branches: [master]
pull_request:
branches: [master]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Create Maven Settings
run: |
mkdir -p ~/.m2
printf '<settings>\n <servers>\n <server>\n <id>codice</id>\n <username>x-access-token</username>\n <password>%s</password>\n </server>\n </servers>\n</settings>\n' "${{ github.token }}" > ~/.m2/settings.xml

- name: Build
run: mvn clean install -B

- name: Upload Coverage
if: always()
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: '**/target/site/jacoco/'
retention-days: 14
102 changes: 102 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: Re-deploy Tag

on:
workflow_dispatch:
inputs:
tag:
description: 'Tag to deploy (e.g., ddf-jsonrpc-0.10.3)'
required: true
type: string
jdkVersion:
description: 'JDK version'
required: true
default: '17'
type: choice
options:
- '11'
- '17'
testRun:
description: 'Test run (no actual deployment)'
required: false
default: false
type: boolean

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Validate Tag Exists
env:
GH_TOKEN: ${{ github.token }}
run: |
TAG="${{ inputs.tag }}"
echo "Checking if tag '$TAG' exists..."

if ! gh api repos/${{ github.repository }}/git/refs/tags/${TAG} > /dev/null 2>&1; then
echo "::error::Tag '$TAG' does not exist in this repository"
exit 1
fi

echo "Tag '$TAG' exists"

- name: Setup JDK ${{ inputs.jdkVersion }}
uses: actions/setup-java@v4
with:
java-version: ${{ inputs.jdkVersion }}
distribution: 'temurin'
cache: 'maven'

- name: Checkout Tag
uses: actions/checkout@v4
with:
ref: refs/tags/${{ inputs.tag }}
fetch-depth: 1

- name: Create Maven Settings
run: |
mkdir -p ~/.m2
printf '<settings>\n <servers>\n <server>\n <id>github</id>\n <username>%s</username>\n <password>%s</password>\n </server>\n <server>\n <id>codice</id>\n <username>x-access-token</username>\n <password>%s</password>\n </server>\n </servers>\n</settings>\n' "$GITHUB_ACTOR" "$GITHUB_TOKEN" "$GITHUB_TOKEN" > ~/.m2/settings.xml
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Maven Deploy
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
REPO_URL="https://maven.pkg.github.com/${{ github.repository }}"
if [[ "${{ inputs.testRun }}" == "true" ]]; then
echo "TEST RUN - Would execute:"
echo "mvn deploy -B -Prelease -DskipStatic=true -DskipTests=true -DretryFailedDeploymentCount=10"
echo ""
echo "Validating build would work..."
mvn validate -B -Prelease
else
echo "Deploying ${{ inputs.tag }} to GitHub Packages..."
mvn deploy -B -Prelease \
-DskipStatic=true \
-DskipTests=true \
-DretryFailedDeploymentCount=10 \
-Dreleases.repository.url="$REPO_URL" \
-Dsnapshots.repository.url="$REPO_URL" \
-Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn
fi

- name: Summary
run: |
cat >> $GITHUB_STEP_SUMMARY << EOF
## Re-deploy Summary

| Setting | Value |
|---------|-------|
| Tag | ${{ inputs.tag }} |
| JDK | ${{ inputs.jdkVersion }} |
| Test Run | ${{ inputs.testRun }} |

EOF

if [[ "${{ inputs.testRun }}" == "true" ]]; then
echo "**TEST RUN - No artifacts were deployed**" >> $GITHUB_STEP_SUMMARY
else
echo "**Artifacts deployed to GitHub Packages**" >> $GITHUB_STEP_SUMMARY
fi
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

on:
workflow_dispatch:
inputs:
branch:
description: 'Branch to release'
required: true
default: 'master'
releaseType:
description: 'Release type'
required: true
default: 'Build'
type: choice
options:
- Build
- Release
- RC1
- RC2
- RC3
nextDevVersion:
description: 'Next dev version (blank = auto)'
required: false
skipTests:
description: 'Skip tests'
default: true
type: boolean
testRun:
description: 'Test run only'
default: false
type: boolean
resumeFrom:
description: 'Resume failed deploy from module (e.g. groupId:artifactId)'
required: false

jobs:
release:
uses: codice/release-pipelines/.github/workflows/maven-release.yml@main
with:
app_name: 'ddf-jsonrpc'
branch: ${{ inputs.branch }}
release_type: ${{ inputs.releaseType }}
next_dev_version: ${{ inputs.nextDevVersion }}
skip_tests: ${{ inputs.skipTests }}
test_run: ${{ inputs.testRun }}
resume_from: ${{ inputs.resumeFrom }}
jdk_version_map: '{"master":"17","default":"17"}'
secrets:
app_id: ${{ secrets.RELEASE_APP_ID }}
app_private_key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
10 changes: 5 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,19 @@
</properties>

<scm>
<url>https://github.com/connexta/ddf-jsonrpc.git</url>
<connection>scm:git:https://github.com/connexta/ddf-jsonrpc.git</connection>
<developerConnection>scm:git:https://github.com/connexta/ddf-jsonrpc.git</developerConnection>
<url>https://github.com/codice/ddf-jsonrpc.git</url>
<connection>scm:git:https://github.com/codice/ddf-jsonrpc.git</connection>
<developerConnection>scm:git:https://github.com/codice/ddf-jsonrpc.git</developerConnection>
<tag>HEAD</tag>
</scm>

<distributionManagement>
<snapshotRepository>
<id>snapshots</id>
<id>github</id>
<url>${snapshots.repository.url}</url>
</snapshotRepository>
<repository>
<id>releases</id>
<id>github</id>
<url>${releases.repository.url}</url>
</repository>
</distributionManagement>
Expand Down
Loading