Skip to content

Commit a607f1d

Browse files
committed
On branch edburns/dd-2785864-pre-public-non-code-changes Publish to snapshots to maven central instead of GitHub packages
modified: .github/workflows/publish-snapshot.ym modified: README.md modified: pom.xml - Publish to snapshots to maven central instead of GitHub packages no changes added to commit (use "git add" and/or "git commit -a")
1 parent a5ee484 commit a607f1d

File tree

3 files changed

+23
-38
lines changed

3 files changed

+23
-38
lines changed

.github/workflows/publish-snapshot.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Publish Snapshot to GitHub Packages
1+
name: Publish Snapshot to Maven Central
22

33
env:
44
HUSKY: 0
@@ -8,15 +8,14 @@ on:
88

99
permissions:
1010
contents: read
11-
packages: write
1211

1312
concurrency:
1413
group: publish-snapshot
1514
cancel-in-progress: false
1615

1716
jobs:
1817
publish-snapshot:
19-
name: Publish SNAPSHOT to GitHub Packages
18+
name: Publish SNAPSHOT to Maven Central
2019
runs-on: ubuntu-latest
2120
steps:
2221
- uses: actions/checkout@v6
@@ -31,9 +30,9 @@ jobs:
3130
java-version: "17"
3231
distribution: "temurin"
3332
cache: "maven"
34-
server-id: github
35-
server-username: PACKAGES_USERNAME
36-
server-password: PACKAGES_TOKEN
33+
server-id: central
34+
server-username: MAVEN_USERNAME
35+
server-password: MAVEN_PASSWORD
3736

3837
- name: Verify version is a SNAPSHOT
3938
run: |
@@ -45,10 +44,10 @@ jobs:
4544
fi
4645
echo "### Snapshot Publish" >> $GITHUB_STEP_SUMMARY
4746
echo "- **Version:** $VERSION" >> $GITHUB_STEP_SUMMARY
48-
echo "- **Repository:** GitHub Packages (github/copilot-sdk-java)" >> $GITHUB_STEP_SUMMARY
47+
echo "- **Repository:** Maven Central Snapshots" >> $GITHUB_STEP_SUMMARY
4948
5049
- name: Deploy Snapshot
5150
run: mvn -B deploy -DskipTests
5251
env:
53-
PACKAGES_TOKEN: ${{ secrets.GITHUB_TOKEN }}
54-
PACKAGES_USERNAME: ${{ github.actor }}
52+
MAVEN_USERNAME: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
53+
MAVEN_PASSWORD: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}

README.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ Java SDK for programmatic control of GitHub Copilot CLI, enabling you to build A
3939

4040
#### Snapshot Builds
4141

42-
Snapshot builds of the next development version are published to GitHub Packages. To use them, add the repository and update the dependency version in your `pom.xml`:
42+
Snapshot builds of the next development version are published to Maven Central Snapshots. To use them, add the repository and update the dependency version in your `pom.xml`:
4343

4444
```xml
4545
<repositories>
4646
<repository>
47-
<id>github</id>
48-
<url>https://maven.pkg.github.com/github/copilot-sdk-java</url>
47+
<id>central-snapshots</id>
48+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
4949
<snapshots><enabled>true</enabled></snapshots>
5050
</repository>
5151
</repositories>
@@ -57,20 +57,6 @@ Snapshot builds of the next development version are published to GitHub Packages
5757
</dependency>
5858
```
5959

60-
GitHub Packages requires authentication even for public packages. Add your credentials to `~/.m2/settings.xml`:
61-
62-
```xml
63-
<settings>
64-
<servers>
65-
<server>
66-
<id>github</id>
67-
<username>YOUR_GITHUB_USERNAME</username>
68-
<password>YOUR_GITHUB_TOKEN</password><!-- needs read:packages scope -->
69-
</server>
70-
</servers>
71-
</settings>
72-
```
73-
7460
### Gradle
7561

7662
```groovy

pom.xml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@
3838

3939
<distributionManagement>
4040
<snapshotRepository>
41-
<id>github</id>
42-
<url>https://maven.pkg.github.com/github/copilot-sdk-java</url>
41+
<id>central</id>
42+
<url>https://central.sonatype.com/repository/maven-snapshots/</url>
4343
</snapshotRepository>
4444
</distributionManagement>
4545

@@ -413,6 +413,16 @@
413413
</dependency>
414414
</dependencies>
415415
</plugin>
416+
<plugin>
417+
<groupId>org.sonatype.central</groupId>
418+
<artifactId>central-publishing-maven-plugin</artifactId>
419+
<version>0.10.0</version>
420+
<extensions>true</extensions>
421+
<configuration>
422+
<publishingServerId>central</publishingServerId>
423+
<autoPublish>true</autoPublish>
424+
</configuration>
425+
</plugin>
416426
</plugins>
417427
</build>
418428

@@ -571,16 +581,6 @@
571581
</execution>
572582
</executions>
573583
</plugin>
574-
<plugin>
575-
<groupId>org.sonatype.central</groupId>
576-
<artifactId>central-publishing-maven-plugin</artifactId>
577-
<version>0.10.0</version>
578-
<extensions>true</extensions>
579-
<configuration>
580-
<publishingServerId>central</publishingServerId>
581-
<autoPublish>true</autoPublish>
582-
</configuration>
583-
</plugin>
584584
</plugins>
585585
</build>
586586
</profile>

0 commit comments

Comments
 (0)