Skip to content

Commit feda479

Browse files
authored
Switch to Nexus (repo.codice.org)
2 parents d2be3f3 + 7a91bcb commit feda479

3 files changed

Lines changed: 13 additions & 64 deletions

File tree

.github/workflows/ci.yml

Lines changed: 9 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,6 @@ jobs:
3838
distribution: 'temurin'
3939
cache: maven
4040

41-
- name: Configure Maven settings
42-
uses: s4u/maven-settings-action@v3.0.0
43-
with:
44-
servers: |
45-
[{
46-
"id": "github",
47-
"username": "${{ github.actor }}",
48-
"password": "${{ secrets.GITHUB_TOKEN }}"
49-
}]
50-
repositories: |
51-
[{
52-
"id": "github",
53-
"url": "https://maven.pkg.github.com/codice/*",
54-
"snapshots": {"enabled": true}
55-
}]
56-
5741
- name: Build
5842
run: mvn clean install $MAVEN_CLI_OPTS
5943

@@ -72,22 +56,6 @@ jobs:
7256
distribution: 'temurin'
7357
cache: maven
7458

75-
- name: Configure Maven settings
76-
uses: s4u/maven-settings-action@v3.0.0
77-
with:
78-
servers: |
79-
[{
80-
"id": "github",
81-
"username": "${{ github.actor }}",
82-
"password": "${{ secrets.GITHUB_TOKEN }}"
83-
}]
84-
repositories: |
85-
[{
86-
"id": "github",
87-
"url": "https://maven.pkg.github.com/codice/*",
88-
"snapshots": {"enabled": true}
89-
}]
90-
9159
- name: Build
9260
run: mvn clean install $MAVEN_CLI_OPTS
9361

@@ -98,8 +66,6 @@ jobs:
9866
(github.ref == 'refs/heads/master' || contains(github.ref, '.x'))
9967
runs-on: ubuntu-latest
10068
environment: production
101-
permissions:
102-
packages: write
10369
steps:
10470
- name: Checkout
10571
uses: actions/checkout@v4
@@ -111,36 +77,18 @@ jobs:
11177
distribution: 'temurin'
11278
cache: maven
11379

114-
- name: Configure Maven settings
115-
uses: s4u/maven-settings-action@v3.0.0
116-
with:
117-
servers: |
118-
[{
119-
"id": "github",
120-
"username": "${{ github.actor }}",
121-
"password": "${{ secrets.GITHUB_TOKEN }}"
122-
},
123-
{
124-
"id": "releases",
125-
"username": "${{ github.actor }}",
126-
"password": "${{ secrets.GITHUB_TOKEN }}"
127-
},
128-
{
129-
"id": "snapshots",
130-
"username": "${{ github.actor }}",
131-
"password": "${{ secrets.GITHUB_TOKEN }}"
132-
}]
133-
repositories: |
134-
[{
135-
"id": "github",
136-
"url": "https://maven.pkg.github.com/codice/*",
137-
"snapshots": {"enabled": true}
138-
}]
80+
- name: Create Maven Settings
81+
env:
82+
NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
83+
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
84+
run: |
85+
mkdir -p ~/.m2
86+
printf '<settings>\n <servers>\n <server>\n <id>releases</id>\n <username>%s</username>\n <password>%s</password>\n </server>\n <server>\n <id>snapshots</id>\n <username>%s</username>\n <password>%s</password>\n </server>\n </servers>\n</settings>\n' "$NEXUS_USERNAME" "$NEXUS_PASSWORD" "$NEXUS_USERNAME" "$NEXUS_PASSWORD" > ~/.m2/settings.xml
13987
14088
- name: Deploy
14189
run: |
14290
mvn deploy $MAVEN_CLI_OPTS \
14391
-DskipTests=true \
14492
-DretryFailedDeploymentCount=10 \
145-
-Dreleases.repository.url=https://maven.pkg.github.com/codice/ddf-parent \
146-
-Dsnapshots.repository.url=https://maven.pkg.github.com/codice/ddf-parent
93+
-Dreleases.repository.url=https://repo.codice.org/repository/maven-releases/ \
94+
-Dsnapshots.repository.url=https://repo.codice.org/repository/maven-snapshots/

.github/workflows/release.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ on:
3232

3333
permissions:
3434
contents: read
35-
packages: write
3635

3736
jobs:
3837
release:
39-
uses: codice/release-pipelines/.github/workflows/maven-release.yml@main
38+
uses: codice/release-pipelines/.github/workflows/maven-release.yml@nexus-deploy
4039
with:
4140
app_name: 'ddf-parent'
4241
branch: ${{ inputs.branch }}
@@ -54,3 +53,5 @@ jobs:
5453
app_private_key: ${{ secrets.RELEASE_APP_PRIVATE_KEY }}
5554
dockerhub_username: ${{ secrets.DOCKERHUB_USERNAME }}
5655
dockerhub_token: ${{ secrets.DOCKERHUB_TOKEN }}
56+
nexus_username: ${{ secrets.NEXUS_USERNAME }}
57+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
<repository>
144144
<id>codice</id>
145145
<name>Codice Repository</name>
146-
<url>http://artifacts.codice.org/content/groups/public/</url>
146+
<url>https://repo.codice.org/repository/maven-public/</url>
147147
</repository>
148148
</repositories>
149149
</project>

0 commit comments

Comments
 (0)