Skip to content

Commit

Permalink
feat: github package token
Browse files Browse the repository at this point in the history
  • Loading branch information
tintinkung committed Apr 22, 2024
1 parent c5e4ca3 commit 9bbbb66
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ jobs:
java-version: '17'
distribution: 'temurin'
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
# settings-path: ${{ github.workspace }} # location for the settings.xml file
settings-path: ${{ github.workspace }} # location for the settings.xml file

- name: Build with Maven
run: mvn -B package --file pom.xml

- name: Publish to GitHub Packages Apache Maven
run: mvn --batch-mode deploy # run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml
run: mvn --batch-mode deploy -s $GITHUB_WORKSPACE/settings.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
</properties>
<distributionManagement>
<repository>
<id>github</id>
<id>aseanbte-repo</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/asean-build-the-earth/alps-lib-asean</url>
</repository>
Expand Down
37 changes: 37 additions & 0 deletions settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">

<activeProfiles>
<activeProfile>github</activeProfile>
</activeProfiles>

<profiles>
<profile>
<id>github</id>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/asean-build-the-earth/alps-lib-asean</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>
</profiles>

<servers>
<server>
<id>aseanbte-repo</id>
<username>asean-build-the-earth</username>
<!-- Public token with `read:packages` scope -->
<password>&#103;&#104;&#112;&#95;&#74;&#103;&#120;&#105;&#121;&#107;&#56;&#107;&#80;&#114;&#49;&#118;&#51;&#74;&#113;&#111;&#66;&#102;&#74;&#113;&#97;&#76;&#56;&#79;&#56;&#116;&#118;&#85;&#89;&#70;&#52;&#78;&#118;&#87;&#78;&#89;</password>
</server>
</servers>
</settings>

0 comments on commit 9bbbb66

Please # to comment.