Skip to content

Commit

Permalink
Refine workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
spannm committed Feb 26, 2024
1 parent 6e6e6c9 commit e1e06ff
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 26 deletions.
19 changes: 2 additions & 17 deletions .github/workflows/ci_jdk11_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,9 @@ jobs:
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 }}}
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo clean package

deploy:
needs: build
Expand All @@ -55,17 +49,8 @@ jobs:
server-password: SONATYPE_OSSRH_PASSWORD

- name: Deploy to Sonatype snapshot repo
run: mvn --batch-mode --file pom.xml --activate-profiles fast deploy
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo,fast deploy
env:
SONATYPE_OSSRH_USERNAME: ${{ secrets.SONATYPE_OSSRH_USERNAME }}
SONATYPE_OSSRH_PASSWORD: ${{ secrets.SONATYPE_OSSRH_PASSWORD }}

- name: Set up Java for deployment to GitHub Packages
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
- name: Deploy snapshot to Github packages
run: mvn -X --batch-mode --file pom.xml --activate-profiles fast,github-deploy-snapshot-package deploy
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion .github/workflows/ci_jdk11_win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
cache: maven

- name: Build with Maven/JDK 11 on Windows
run: mvn --batch-mode --file pom.xml clean verify
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo clean verify
3 changes: 2 additions & 1 deletion .github/workflows/ci_jdk17_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:
java-version: '17'
distribution: 'temurin'
cache: maven

- name: Build with Maven/JDK 17 on Ubuntu
run: mvn --batch-mode --file pom.xml clean verify
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo clean verify
3 changes: 2 additions & 1 deletion .github/workflows/ci_jdk21_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ jobs:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Build with Maven/JDK 21 on Ubuntu
run: mvn --batch-mode --file pom.xml clean verify
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo clean verify
9 changes: 7 additions & 2 deletions .github/workflows/sonar_jdk17_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,29 @@ on:
pull_request:
branches:
- master
workflow_dispatch:
branches:
- master

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
# disabling shallow clone is recommended for improving relevancy of reporting
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: temurin
cache: maven

- name: Build with Maven/JDK 17, test with SonarCloud
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: mvn --batch-mode --file pom.xml --activate-profiles sonarcloud clean verify
run: mvn --batch-mode --file pom.xml --activate-profiles add-sonatype-snapshots-repo,sonarcloud clean verify
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,12 @@
</profile>

<profile>
<id>github-package-repo-jackcess</id>
<id>add-sonatype-snapshots-repo</id>
<repositories>
<repository>
<id>github-jackcess</id>
<name>${developerId} github packages</name>
<url>https://maven.pkg.github.com/${developerId}/${dep.jackcess.artifcactId}</url>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
Expand Down

0 comments on commit e1e06ff

Please sign in to comment.