From 327d3e6feaac5062e6cc552b67b780bead4cf384 Mon Sep 17 00:00:00 2001 From: Ali Ince Date: Tue, 26 Sep 2023 11:09:20 +0100 Subject: [PATCH] build: set custom credentials --- .github/workflows/build.yml | 8 ++++---- .github/workflows/publish.yml | 12 +++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 274a8d2..436a62c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - packages: read steps: - uses: actions/checkout@v4 - name: Set up JDK 11 @@ -35,7 +34,8 @@ jobs: with: java-version: '11' 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 + server-id: github + server-username: PACKAGES_USERNAME + server-password: ${{ secrets.PACKAGES_PASSWORD }} - name: Build with Maven - run: mvn -B verify --file pom.xml -s $GITHUB_WORKSPACE/settings.xml + run: mvn -B verify diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 271deae..0e84b12 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -9,7 +9,6 @@ jobs: runs-on: ubuntu-latest permissions: contents: read - packages: write steps: - uses: actions/checkout@v3 @@ -18,13 +17,12 @@ jobs: with: java-version: '11' 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 - + server-id: github + server-username: PACKAGES_USERNAME + server-password: ${{ secrets.PACKAGES_PASSWORD }} - name: Build with Maven - run: mvn -B package --file pom.xml - + run: mvn -B package - name: Publish to GitHub Packages Apache Maven - run: mvn deploy -s $GITHUB_WORKSPACE/settings.xml + run: mvn deploy env: GITHUB_TOKEN: ${{ github.token }}