Skip to content

Commit

Permalink
build: use environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-ince committed Sep 26, 2023
1 parent 6e801d0 commit de4db31
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,8 +23,6 @@ jobs:

build:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
Expand All @@ -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 }}

10 changes: 4 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: read

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
Expand All @@ -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 }}

0 comments on commit de4db31

Please sign in to comment.