diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aa7dd5b..566b118 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,8 +10,6 @@ jobs: pr-check: if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest - permissions: - contents: read steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v3 @@ -25,8 +23,6 @@ jobs: build: runs-on: ubuntu-latest - permissions: - contents: read steps: - uses: actions/checkout@v4 - name: Set up JDK 11 @@ -35,7 +31,11 @@ jobs: java-version: '11' distribution: 'temurin' server-id: github - server-username: ${{ vars.PACKAGES_USERNAME }} - server-password: ${{ secrets.PACKAGES_PASSWORD }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD - name: Build with Maven run: mvn -B verify + env: + MAVEN_USERNAME: ${{ vars.PACKAGES_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.PACKAGES_PASSWORD }} + diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0a67fa2..1aceb52 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,9 +7,6 @@ on: jobs: publish: runs-on: ubuntu-latest - permissions: - contents: read - steps: - uses: actions/checkout@v3 - name: Set up JDK 11 @@ -18,11 +15,12 @@ jobs: java-version: '11' distribution: 'temurin' server-id: github - server-username: ${{ vars.PACKAGES_USERNAME }} - server-password: ${{ secrets.PACKAGES_PASSWORD }} + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD - name: Build with Maven run: mvn -B package - name: Publish to GitHub Packages Apache Maven run: mvn deploy env: - GITHUB_TOKEN: ${{ github.token }} + MAVEN_USERNAME: ${{ vars.PACKAGES_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.PACKAGES_PASSWORD }}