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
62 changes: 15 additions & 47 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
name: Maven Publish Release
on:
workflow_dispatch:
inputs:
Expand All @@ -21,6 +22,7 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
if: github.actor == 'agaffney' || github.actor == 'verbotenj' || github.actor == 'wolf31o2'
steps:
- uses: actions/checkout@v5
- name: Set up JDK ${{ inputs.javaVersion }}
Expand All @@ -40,52 +42,18 @@ jobs:
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>s3.applause-public-repo</id>
<username>${{ secrets.APPLAUSE_REPO_USER_NAME }}</username>
<password>${{ secrets.APPLAUSE_REPO_PASSWORD }}</password>
</server>
<server>
<id>s3.applause-public-snapshots</id>
<username>${{ secrets.APPLAUSE_REPO_USER_NAME }}</username>
<password>${{ secrets.APPLAUSE_REPO_PASSWORD }}</password>
</server>
<server>
<id>s3.applause-public-repo</id>
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
</server>
<server>
<id>s3.applause-public-snapshots</id>
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
</server>
</servers>


<profiles>
<profile>
<activation>
<activeByDefault>true</activeByDefault>
</activation>

<repositories>
<repository>
<id>applause-public-repo</id>
<name>Repository for Applause public artifacts (releases)</name>
<url>https://repo.applause.com/repository/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</repository>
<repository>
<id>applause-public-snapshots</id>
<name>Repository for Applause public artifacts (snapshots)</name>
<url>https://repo.applause.com/repository/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>applause-public-repo</id>
<name>Repository for Applause public artifacts (releases)</name>
<url>https://repo.applause.com/repository/public</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>false</enabled></snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
</settings>
EOF

Expand All @@ -108,8 +76,8 @@ jobs:
git commit -am "GHA: release version \${VERSION}"
git tag v\${VERSION} -am "GHA: publish public-$GITHUB_REPO_NAME v\${VERSION}"
git log -1
# git push origin v\${VERSION}
# git push origin HEAD:${{ inputs.branch }}
git push origin v\${VERSION}
git push origin HEAD:${{ inputs.branch }}

# Increment incremental version and set SNAPSHOT
mvn build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.minorVersion}.\\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
Expand All @@ -121,4 +89,4 @@ jobs:
VERSION=`cat VERSION`
git commit -am "GHA: SNAPSHOT version \${VERSION}"
git diff HEAD^ HEAD
# git push origin HEAD:${{ inputs.branch }}
git push origin HEAD:${{ inputs.branch }}
87 changes: 0 additions & 87 deletions .github/workflows/publish_private.yml

This file was deleted.

61 changes: 61 additions & 0 deletions .github/workflows/publish_snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Maven Publish Snapshot

on:
workflow_dispatch:
inputs:
javaVersion:
description: "Java version to use"
default: "21"
type: string
mavenProperties:
description: "Maven properties to use"
default: "-DskipGithub=true"
type: string
mavenTasks:
description: "Maven tasks to use"
default: "clean install deploy"
type: string

permissions:
contents: read

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Set up JDK ${{ inputs.javaVersion }}
uses: actions/setup-java@v5
with:
java-version: "${{ inputs.javaVersion }}"
distribution: "temurin"
- name: Set up Maven
uses: hb0730/maven-action@v1.0.2
with:
maven-version: 3.8.9

- name: Create Maven settings.xml
run: |
cat << 'EOF' > $HOME/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>s3.applause-public-repo</id>
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
</server>
<server>
<id>s3.applause-public-snapshots</id>
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
</server>
</servers>
</settings>
EOF

- name: Publish
run: |
mvn ${{ inputs.mavenProperties }} ${{ inputs.mavenTasks }}
Loading