Skip to content

Commit

Permalink
Configuring GitHub package Maven repos.
Browse files Browse the repository at this point in the history
  • Loading branch information
david-waltermire committed Jul 30, 2024
1 parent 629a1f9 commit 6f16e27
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 14 deletions.
36 changes: 22 additions & 14 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ on:
- feature/*
merge_group:
workflow_dispatch:
name: Build and Test Development Code
name: Build and Test Java
jobs:
build-artifacts:
name: Build Java Artifacts
name: Build and Test Artifacts
runs-on: ubuntu-latest
permissions:
actions: read
Expand All @@ -38,20 +38,28 @@ jobs:
with:
maven-version: 3.9.3
- id: setup-java-deploy
name: Set up JDK 11 (deploy)
if: ${{ env.BUILD_SNAPSHOT == 'true' }}
name: Set up JDK 11
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
- name: Set up JDK 11 (build only)
if: ${{ steps.setup-java-deploy.outcome == 'skipped' }}
uses: actions/setup-java@5896cecc08fd8a1fbdfaf517e29b571164b031f7
cache: maven
# - name: Cache Maven packages
# uses: actions/cache@v3
# with:
# path: ~/.m2
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2
- uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd
with:
java-version: 11
distribution: 'temurin'
cache: 'maven'
servers: |
[{
"id": "github",
"configuration": {
"username": "x-access-token",
"password": "GITHUB_TOKEN"
}
}]
- name: Initialize CodeQL
if: github.event_name == 'push'
uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c
Expand All @@ -64,7 +72,7 @@ jobs:
name: Build, Test and DEPLOY SNAPSHOT Code
if: ${{ env.BUILD_SNAPSHOT == 'true' }}
run: |
mvn -B -e --batch-mode -Prelease -Preporting deploy -Dmaven.deploy.skip=releases
mvn -B -e --batch-mode -Prelease deploy -Dmaven.deploy.skip=releases
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and Test Code
Expand All @@ -75,8 +83,8 @@ jobs:
if: github.event_name == 'push'
uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c
with:
upload: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'develop' && 'always' || 'never' }}
upload: ${{ github.ref_name == 'develop' && 'always' || 'never' }}
- name: Test Website
run: |
# this needs to be run as a second build to ensure source is fully generated by the previous step
mvn -B -e -Prelease -Preporting install site site:stage
mvn -B -e -Prelease install site site:stage
21 changes: 21 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,26 @@
</reporting>

<profiles>
<profile>
<id>github</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>central</id>
<url>https://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/metaschema-framework/oss-maven</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
</profile>

<profile>
<id>gpg</id>
<build>
Expand Down Expand Up @@ -762,6 +782,7 @@
</build>
</profile>
</profiles>

<modules>
<module>oss-build-support</module>
<module>oss-parent</module>
Expand Down

0 comments on commit 6f16e27

Please sign in to comment.