Skip to content

Commit d9c2951

Browse files
committed
Update GitHub Maven repo config
1 parent d911d11 commit d9c2951

3 files changed

Lines changed: 20 additions & 61 deletions

File tree

.github/workflows/cucumber-ui-container.yml

Lines changed: 13 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ jobs:
3636
MAVEN_OFFLINE: "true"
3737
MAVEN_NO_SNAPSHOT_UPDATES: "true"
3838
MAVEN_AUTO_FALLBACK_ONLINE: "true"
39+
GH_MAVEN_USERNAME: ${{ secrets.GH_PACKAGES_USERNAME != '' && secrets.GH_PACKAGES_USERNAME || github.actor }}
40+
GH_MAVEN_TOKEN: ${{ secrets.GH_PACKAGES_TOKEN != '' && secrets.GH_PACKAGES_TOKEN || secrets.GITHUB_TOKEN }}
3941
steps:
4042
- name: Checkout test-cucumber-framework
4143
uses: actions/checkout@v4
@@ -45,35 +47,21 @@ jobs:
4547
- name: Ensure runner script is executable
4648
run: chmod +x test-cucumber-framework/run-in-container.sh
4749

48-
- name: Configure Maven settings for GitHub Packages
49-
shell: bash
50-
run: |
51-
mkdir -p "${HOME}/.m2"
52-
cat > "${HOME}/.m2/settings.xml" <<EOF
53-
<settings>
54-
<servers>
55-
<server>
56-
<id>github-test-parent-pom</id>
57-
<username>${GITHUB_ACTOR}</username>
58-
<password>${GITHUB_TOKEN}</password>
59-
</server>
60-
<server>
61-
<id>github-test-automation-fwk</id>
62-
<username>${GITHUB_ACTOR}</username>
63-
<password>${GITHUB_TOKEN}</password>
64-
</server>
65-
</servers>
66-
</settings>
67-
EOF
68-
env:
69-
GITHUB_ACTOR: ${{ github.actor }}
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
- name: Set up JDK 17 and Maven settings
51+
uses: actions/setup-java@v4
52+
with:
53+
distribution: temurin
54+
java-version: "17"
55+
cache: maven
56+
server-id: github
57+
server-username: GH_MAVEN_USERNAME
58+
server-password: GH_MAVEN_TOKEN
7159

7260
- name: Execute UI tests in shared container image
7361
run: ./test-cucumber-framework/run-in-container.sh
7462
env:
75-
GITHUB_ACTOR: ${{ github.actor }}
76-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
GITHUB_ACTOR: ${{ env.GH_MAVEN_USERNAME }}
64+
GITHUB_TOKEN: ${{ env.GH_MAVEN_TOKEN }}
7765

7866
- name: Upload Cucumber HTML reports
7967
if: always()

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,7 @@ If package access is private, configure GitHub Packages credentials in `~/.m2/se
5252
<settings>
5353
<servers>
5454
<server>
55-
<id>github-test-parent-pom</id>
56-
<username>${env.GITHUB_ACTOR}</username>
57-
<password>${env.GITHUB_TOKEN}</password>
58-
</server>
59-
<server>
60-
<id>github-test-automation-fwk</id>
55+
<id>github</id>
6156
<username>${env.GITHUB_ACTOR}</username>
6257
<password>${env.GITHUB_TOKEN}</password>
6358
</server>

pom.xml

Lines changed: 6 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,9 @@
6666

6767
<repositories>
6868
<repository>
69-
<id>github-test-parent-pom</id>
70-
<name>GitHub Maven - test-parent-pom</name>
71-
<url>https://maven.pkg.github.com/NDViet/test-parent-pom</url>
72-
<releases>
73-
<enabled>true</enabled>
74-
<updatePolicy>always</updatePolicy>
75-
</releases>
76-
<snapshots>
77-
<enabled>true</enabled>
78-
<updatePolicy>always</updatePolicy>
79-
</snapshots>
80-
</repository>
81-
<repository>
82-
<id>github-test-automation-fwk</id>
83-
<name>GitHub Maven - test-automation-fwk</name>
84-
<url>https://maven.pkg.github.com/NDViet/test-automation-fwk</url>
69+
<id>github</id>
70+
<name>GitHub Maven - NDViet</name>
71+
<url>https://maven.pkg.github.com/NDViet/*</url>
8572
<releases>
8673
<enabled>true</enabled>
8774
<updatePolicy>always</updatePolicy>
@@ -95,20 +82,9 @@
9582

9683
<pluginRepositories>
9784
<pluginRepository>
98-
<id>github-test-parent-pom</id>
99-
<name>GitHub Maven - test-parent-pom</name>
100-
<url>https://maven.pkg.github.com/NDViet/test-parent-pom</url>
101-
<releases>
102-
<enabled>true</enabled>
103-
</releases>
104-
<snapshots>
105-
<enabled>true</enabled>
106-
</snapshots>
107-
</pluginRepository>
108-
<pluginRepository>
109-
<id>github-test-automation-fwk</id>
110-
<name>GitHub Maven - test-automation-fwk</name>
111-
<url>https://maven.pkg.github.com/NDViet/test-automation-fwk</url>
85+
<id>github</id>
86+
<name>GitHub Maven - NDViet</name>
87+
<url>https://maven.pkg.github.com/NDViet/*</url>
11288
<releases>
11389
<enabled>true</enabled>
11490
</releases>

0 commit comments

Comments
 (0)