Skip to content

Commit 50bdf20

Browse files
committed
package updates
1 parent 4386fab commit 50bdf20

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,34 @@ jobs:
4242
env:
4343
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4444
run: |
45+
# Create Maven settings for GitHub Packages authentication
46+
cat > ~/.m2/settings.xml << EOF
47+
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
48+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
49+
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
50+
http://maven.apache.org/xsd/settings-1.0.0.xsd">
51+
<servers>
52+
<server>
53+
<id>github</id>
54+
<username>${GITHUB_ACTOR}</username>
55+
<password>${GITHUB_TOKEN}</password>
56+
</server>
57+
</servers>
58+
</settings>
59+
EOF
60+
4561
mvn clean deploy -DskipTests
62+
63+
- name: Make package public
64+
run: |
65+
# Get the package name from pom.xml
66+
PACKAGE_NAME="com.featurevisor__featurevisor-java"
67+
68+
# Make the package public using GitHub API
69+
curl -X POST \
70+
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
71+
-H "Accept: application/vnd.github.v3+json" \
72+
https://api.github.com/user/packages/maven/$PACKAGE_NAME/visibility \
73+
-d '{"visibility":"public"}'
74+
75+
echo "Made package $PACKAGE_NAME public"

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ In your Java application, update `pom.xml` to add the following:
5858

5959
### Repository
6060

61-
For finding GitHub Package:
61+
For finding GitHub Package (public package):
6262

6363
```xml
6464
<repositories>
@@ -87,7 +87,9 @@ Find latest version here: [https://github.com/featurevisor/featurevisor-java/pac
8787

8888
### Authentication
8989

90-
To authenticate with GitHub Packages, in your `~/.m2/settings.xml` file, add the following:
90+
**Note:** This package is published as a public package and should be accessible without authentication. If you encounter 401 errors, please ensure you're using the correct repository URL.
91+
92+
If you need to authenticate with GitHub Packages (for private packages), in your `~/.m2/settings.xml` file, add the following:
9193

9294
```xml
9395
<?xml version="1.0" encoding="UTF-8"?>

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
<maven.compiler.testTarget>15</maven.compiler.testTarget>
5959
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
6060
<jackson.version>2.15.2</jackson.version>
61+
<!-- GitHub Packages configuration -->
62+
<github.packages.public>true</github.packages.public>
6163
</properties>
6264

6365
<dependencies>

0 commit comments

Comments
 (0)