Skip to content

Commit

Permalink
test: build as jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
grigoriev committed Aug 2, 2024
1 parent 14aa8cc commit e3a29f2
Showing 1 changed file with 42 additions and 25 deletions.
67 changes: 42 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,30 +49,6 @@ jobs:
"id": "s3",
"username": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_ACCESS_KEY }}",
"password": "${{ secrets.S3_SBB_POLARION_MAVEN_REPO_RW_SECRET_ACCESS_KEY }}"
},
{
"id": "github",
"username": "${env.GITHUB_ACTOR}",
"password": "${env.GITHUB_TOKEN}"
},
{
"id": "ossrh",
"username": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_USERNAME }}",
"password": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_TOKEN }}"
},
{
"id": "gpg.passphrase",
"passphrase": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}"
}
]
profiles: >
[
{
"id": "deploy-github-packages",
"properties":
{
"altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}"
}
}
]
- name: Print settings.xml
Expand All @@ -95,7 +71,6 @@ jobs:
packages: write
env:
GITHUB_TOKEN: ${{ github.token }}
MARKDOWN2HTML_MAVEN_PLUGIN_FAIL_ON_ERROR: true
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Set up JDK and Maven
Expand All @@ -113,6 +88,22 @@ jobs:
/home/runner/.m2
/home/runner/work
key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }}
- uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22
with:
servers: >
[
{
"id": "ossrh",
"username": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_USERNAME }}",
"password": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_TOKEN }}"
},
{
"id": "gpg.passphrase",
"passphrase": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}"
}
]
- name: Print settings.xml
run: cat /home/runner/.m2/settings.xml
- name: Publish to Maven Central
# if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }}
run: mvn --batch-mode -DskipTests=true package -P gpg-sign -P nexus-staging
Expand Down Expand Up @@ -144,6 +135,32 @@ jobs:
/home/runner/.m2
/home/runner/work
key: ${{ runner.os }}-mvn-${{ hashFiles('**/pom.xml') }}
- uses: whelk-io/maven-settings-xml-action@9dc09b23833fa9aa7f27b63db287951856f3433d # v22
with:
servers: >
[
{
"id": "github",
"username": "${env.GITHUB_ACTOR}",
"password": "${env.GITHUB_TOKEN}"
},
{
"id": "gpg.passphrase",
"passphrase": "${{ secrets.COM_SONATYPE_CENTRAL_POLARION_OPENSOURCE_GPG_PASSPHRASE }}"
}
]
profiles: >
[
{
"id": "deploy-github-packages",
"properties":
{
"altDeploymentRepository": "github::default::https://maven.pkg.github.com/${{ github.repository }}"
}
}
]
- name: Print settings.xml
run: cat /home/runner/.m2/settings.xml
- name: Publish to GitHub Packages
# if: ${{ !endsWith(steps.artefact_version.outputs.version, '-SNAPSHOT') && github.ref == 'refs/heads/main' }}
run: mvn --batch-mode -DskipTests=true package -P gpg-sign -P deploy-github-packages

0 comments on commit e3a29f2

Please sign in to comment.