Skip to content

Commit

Permalink
Resolve authentication issue in github workflow during deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
spannm committed Feb 22, 2024
1 parent 33ce2dd commit 1c68d46
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 15 deletions.
26 changes: 22 additions & 4 deletions .github/workflows/ci_jdk11_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,26 @@ on:
- master

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: temurin
cache: maven
server-id: github-jackcess # value of repository/id field of the pom.xml
server-username: GH_PACKAGE_REPO_USERNAME # env variable name for username
server-password: GH_PACKAGE_REPO_PASSWORD # env variable name for GitHub Personal Access Token
- name: Build with Maven/JDK 11 on Ubuntu
run: mvn --batch-mode --file pom.xml --activate-profiles github-package-repo-jackcess clean package
env:
GH_PACKAGE_REPO_USERNAME: ${{ secrets.GH_PACKAGE_REPO_USERNAME }}
GH_PACKAGE_REPO_PASSWORD: ${{ secrets.GH_PACKAGE_REPO_PASSWORD }}}
deploy_deploy_sonatype:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -25,7 +43,7 @@ jobs:
server-username: SONATYPE_OSSRH_USERNAME
server-password: SONATYPE_OSSRH_PASSWORD
- name: Build with Maven/JDK 11 on Ubuntu
run: mvn --batch-mode --file pom.xml clean deploy
run: mvn --batch-mode --file pom.xml --activate-profiles fast,github-package-repo-jackcess deploy
env:
SONATYPE_OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
SONATYPE_OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
SONATYPE_OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
SONATYPE_OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}
25 changes: 14 additions & 11 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,6 @@
</site>
</distributionManagement>

<repositories>
<repository>
<id>github-jackcess</id>
<name>${developerId} github packages</name>
<url>https://maven.pkg.github.com/${developerId}/${dep.jackcess.artifcactId}</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

Expand Down Expand Up @@ -326,6 +315,20 @@
</build>
</profile>

<profile>
<id>github-package-repo-jackcess</id>
<repositories>
<repository>
<id>github-jackcess</id>
<name>${developerId} github packages</name>
<url>https://maven.pkg.github.com/${developerId}/${dep.jackcess.artifcactId}</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>

<profile>
<id>release</id>
<activation>
Expand Down

0 comments on commit 1c68d46

Please sign in to comment.