Skip to content

Commit 77ed81a

Browse files
authored
Switch to Nexus (repo.codice.org) (#66)
* Switch to Nexus (repo.codice.org) * Point workflows at main
1 parent 93284cc commit 77ed81a

3 files changed

Lines changed: 14 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 -DskipTests -pl '!docker'
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 -DskipTests -pl '!docker'
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,37 +77,19 @@ 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": "releases",
120-
"username": "${{ github.actor }}",
121-
"password": "${{ secrets.GITHUB_TOKEN }}"
122-
},
123-
{
124-
"id": "snapshots",
125-
"username": "${{ github.actor }}",
126-
"password": "${{ secrets.GITHUB_TOKEN }}"
127-
},
128-
{
129-
"id": "github",
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 \
14593
-pl '!docker' \
146-
-DaltReleaseDeploymentRepository=releases::https://maven.pkg.github.com/codice/acdebugger \
147-
-DaltSnapshotDeploymentRepository=snapshots::https://maven.pkg.github.com/codice/acdebugger
94+
-DaltReleaseDeploymentRepository=releases::https://repo.codice.org/repository/maven-releases/ \
95+
-DaltSnapshotDeploymentRepository=snapshots::https://repo.codice.org/repository/maven-snapshots/

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ on:
33
workflow_dispatch:
44
permissions:
55
contents: read
6-
packages: write
76
jobs:
87
deploy:
98
uses: codice/release-pipelines/.github/workflows/maven-manual-deploy.yml@main
9+
secrets:
10+
nexus_username: ${{ secrets.NEXUS_USERNAME }}
11+
nexus_password: ${{ secrets.NEXUS_PASSWORD }}

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
<repository>
9797
<id>codice</id>
9898
<name>Codice Repository</name>
99-
<url>https://artifacts.codice.org/content/groups/public/</url>
99+
<url>https://repo.codice.org/repository/maven-public/</url>
100100
</repository>
101101
</repositories>
102102

@@ -487,7 +487,7 @@
487487
<pluginRepository>
488488
<id>codice</id>
489489
<name>Codice Repository</name>
490-
<url>https://artifacts.codice.org/content/groups/public/</url>
490+
<url>https://repo.codice.org/repository/maven-public/</url>
491491
</pluginRepository>
492492
</pluginRepositories>
493493

0 commit comments

Comments
 (0)