Skip to content

Commit df9f28e

Browse files
authored
Merge pull request #67 from ApplauseOSS/fix/ci-run-credentials
ci: update snapshot workflow
2 parents f9779af + dac01a4 commit df9f28e

File tree

3 files changed

+76
-134
lines changed

3 files changed

+76
-134
lines changed

.github/workflows/publish.yml

Lines changed: 15 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
name: Maven Publish Release
12
on:
23
workflow_dispatch:
34
inputs:
@@ -21,6 +22,7 @@ on:
2122
jobs:
2223
publish:
2324
runs-on: ubuntu-latest
25+
if: github.actor == 'agaffney' || github.actor == 'verbotenj' || github.actor == 'wolf31o2'
2426
steps:
2527
- uses: actions/checkout@v5
2628
- name: Set up JDK ${{ inputs.javaVersion }}
@@ -40,52 +42,18 @@ jobs:
4042
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
4143
https://maven.apache.org/xsd/settings-1.0.0.xsd">
4244
<servers>
43-
<server>
44-
<id>s3.applause-public-repo</id>
45-
<username>${{ secrets.APPLAUSE_REPO_USER_NAME }}</username>
46-
<password>${{ secrets.APPLAUSE_REPO_PASSWORD }}</password>
47-
</server>
48-
<server>
49-
<id>s3.applause-public-snapshots</id>
50-
<username>${{ secrets.APPLAUSE_REPO_USER_NAME }}</username>
51-
<password>${{ secrets.APPLAUSE_REPO_PASSWORD }}</password>
52-
</server>
45+
<server>
46+
<id>s3.applause-public-repo</id>
47+
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
48+
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
49+
</server>
50+
<server>
51+
<id>s3.applause-public-snapshots</id>
52+
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
53+
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
54+
</server>
5355
</servers>
5456
55-
56-
<profiles>
57-
<profile>
58-
<activation>
59-
<activeByDefault>true</activeByDefault>
60-
</activation>
61-
62-
<repositories>
63-
<repository>
64-
<id>applause-public-repo</id>
65-
<name>Repository for Applause public artifacts (releases)</name>
66-
<url>https://repo.applause.com/repository/public</url>
67-
<releases><enabled>true</enabled></releases>
68-
<snapshots><enabled>false</enabled></snapshots>
69-
</repository>
70-
<repository>
71-
<id>applause-public-snapshots</id>
72-
<name>Repository for Applause public artifacts (snapshots)</name>
73-
<url>https://repo.applause.com/repository/snapshots</url>
74-
<releases><enabled>false</enabled></releases>
75-
<snapshots><enabled>true</enabled></snapshots>
76-
</repository>
77-
</repositories>
78-
<pluginRepositories>
79-
<pluginRepository>
80-
<id>applause-public-repo</id>
81-
<name>Repository for Applause public artifacts (releases)</name>
82-
<url>https://repo.applause.com/repository/public</url>
83-
<releases><enabled>true</enabled></releases>
84-
<snapshots><enabled>false</enabled></snapshots>
85-
</pluginRepository>
86-
</pluginRepositories>
87-
</profile>
88-
</profiles>
8957
</settings>
9058
EOF
9159
@@ -108,8 +76,8 @@ jobs:
10876
git commit -am "GHA: release version \${VERSION}"
10977
git tag v\${VERSION} -am "GHA: publish public-$GITHUB_REPO_NAME v\${VERSION}"
11078
git log -1
111-
# git push origin v\${VERSION}
112-
# git push origin HEAD:${{ inputs.branch }}
79+
git push origin v\${VERSION}
80+
git push origin HEAD:${{ inputs.branch }}
11381
11482
# Increment incremental version and set SNAPSHOT
11583
mvn build-helper:parse-version versions:set -DgenerateBackupPoms=false -DnewVersion=\\${parsedVersion.majorVersion}.\\${parsedVersion.minorVersion}.\\${parsedVersion.nextIncrementalVersion}-SNAPSHOT
@@ -121,4 +89,4 @@ jobs:
12189
VERSION=`cat VERSION`
12290
git commit -am "GHA: SNAPSHOT version \${VERSION}"
12391
git diff HEAD^ HEAD
124-
# git push origin HEAD:${{ inputs.branch }}
92+
git push origin HEAD:${{ inputs.branch }}

.github/workflows/publish_private.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Maven Publish Snapshot
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
javaVersion:
7+
description: "Java version to use"
8+
default: "21"
9+
type: string
10+
mavenProperties:
11+
description: "Maven properties to use"
12+
default: "-DskipGithub=true"
13+
type: string
14+
mavenTasks:
15+
description: "Maven tasks to use"
16+
default: "clean install deploy"
17+
type: string
18+
19+
permissions:
20+
contents: read
21+
22+
jobs:
23+
build-and-publish:
24+
runs-on: ubuntu-latest
25+
steps:
26+
- uses: actions/checkout@v5
27+
- name: Set up JDK ${{ inputs.javaVersion }}
28+
uses: actions/setup-java@v5
29+
with:
30+
java-version: "${{ inputs.javaVersion }}"
31+
distribution: "temurin"
32+
- name: Set up Maven
33+
uses: hb0730/[email protected]
34+
with:
35+
maven-version: 3.8.9
36+
37+
- name: Create Maven settings.xml
38+
run: |
39+
cat << 'EOF' > $HOME/.m2/settings.xml
40+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
41+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
42+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
43+
https://maven.apache.org/xsd/settings-1.0.0.xsd">
44+
<servers>
45+
<server>
46+
<id>s3.applause-public-repo</id>
47+
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
48+
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
49+
</server>
50+
<server>
51+
<id>s3.applause-public-snapshots</id>
52+
<username>${{ secrets.REPO_PUBLISH_AWS_ACCESS_KEY_ID }}</username>
53+
<password>${{ secrets.REPO_PUBLISH_AWS_SECRET_ACCESS_KEY }}</password>
54+
</server>
55+
</servers>
56+
</settings>
57+
EOF
58+
59+
- name: Publish
60+
run: |
61+
mvn ${{ inputs.mavenProperties }} ${{ inputs.mavenTasks }}

0 commit comments

Comments
 (0)