build: Increase delay/retries for nexus2 deployment #103
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Early Access | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
precheck: | |
if: github.repository == 'kordamp/pomchecker' && startsWith(github.event.head_commit.message, 'Releasing version') != true | |
runs-on: ubuntu-latest | |
outputs: | |
VERSION: ${{ steps.vars.outputs.VERSION }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Cancel previous run | |
uses: styfle/[email protected] | |
with: | |
access_token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ vars.JAVA_VERSION }} | |
distribution: ${{ vars.JAVA_DISTRO }} | |
cache: maven | |
- name: Version | |
id: vars | |
shell: bash | |
run: | | |
version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout) | |
echo "VERSION=$(echo $version)" >> $GITHUB_OUTPUT | |
release: | |
needs: [ precheck ] | |
if: endsWith(${{ needs.precheck.outputs.VERSION }}, '-SNAPSHOT') | |
runs-on: ubuntu-latest | |
outputs: | |
JAR_SIZE: ${{ steps.bach.outputs.JAR_SIZE }} | |
JAR_CSUM: ${{ steps.bach.outputs.JAR_CSUM }} | |
DOC_SIZE: ${{ steps.bach.outputs.DOC_SIZE }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup Java | |
uses: actions/setup-java@v4 | |
with: | |
java-version: ${{ vars.JAVA_VERSION }} | |
distribution: ${{ vars.JAVA_DISTRO }} | |
cache: maven | |
- name: Cache Gradle | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/caches | |
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} | |
restore-keys: ${{ runner.os }}-gradle- | |
- name: Cache Gradle wrapper | |
uses: actions/cache@v4 | |
with: | |
path: ~/.gradle/wrapper | |
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }} | |
restore-keys: ${{ runner.os }}-gradlew- | |
- name: Build | |
run: ./mvnw -ntp -B --file pom.xml verify | |
- name: Release | |
uses: jreleaser/release-action@v2 | |
with: | |
setup-java: false | |
env: | |
JRELEASER_PROJECT_VERSION: ${{ needs.precheck.outputs.VERSION }} | |
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }} | |
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }} | |
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }} | |
- name: Grab bach-info | |
id: bach | |
shell: bash | |
run: | | |
VERSION=${{ needs.precheck.outputs.VERSION }} | |
JAR_SIZE=$(ls -l pomchecker-toolprovider/target/pomchecker-toolprovider-${VERSION}.jar | awk '{print $5}') | |
JAR_CSUM=$(shasum -a 256 pomchecker-toolprovider/target/pomchecker-toolprovider-${VERSION}.jar | awk '{print $1}') | |
DOC_SIZE=$(ls -l README.adoc | awk '{print $5}') | |
echo "JAR_SIZE=$(echo $JAR_SIZE)" >> $GITHUB_OUTPUT | |
echo "JAR_CSUM=$(echo $JAR_CSUM)" >> $GITHUB_OUTPUT | |
echo "DOC_SIZE=$(echo $DOC_SIZE)" >> $GITHUB_OUTPUT | |
- name: JReleaser output | |
if: always() | |
uses: actions/upload-artifact@v4 | |
with: | |
name: jreleaser-release | |
path: | | |
out/jreleaser/trace.log | |
out/jreleaser/output.properties | |
update-bach-info: | |
name: Update bach-info | |
needs: [ precheck, release ] | |
runs-on: ubuntu-latest | |
continue-on-error: true | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
repository: kordamp/bach-info | |
ref: 'main' | |
fetch-depth: 0 | |
token: ${{ secrets.GIT_ACCESS_TOKEN }} | |
- name: Download bach-info script | |
run: | | |
curl -sL https://raw.githubusercontent.com/kordamp/pomchecker/master/.github/scripts/update-bach-info.sh --output update-bach-info.sh | |
chmod +x update-bach-info.sh | |
- name: Commit | |
env: | |
TAG: "early-access" | |
VERSION: ${{ needs.precheck.outputs.VERSION }} | |
JAR_SIZE: ${{ needs.release.outputs.JAR_SIZE }} | |
JAR_CSUM: ${{ needs.release.outputs.JAR_CSUM }} | |
DOC_SIZE: ${{ needs.release.outputs.DOC_SIZE }} | |
run: sh update-bach-info.sh |