From bbdb40c8a2a775b10a4a693e64a36c62c4bb29b1 Mon Sep 17 00:00:00 2001 From: Michiel Meeuwissen Date: Mon, 23 Jan 2023 22:57:09 +0100 Subject: [PATCH] Updating actions. --- .github/workflows/branch.yml | 14 +++----------- .github/workflows/maven.yml | 8 +++----- .github/workflows/pull.yml | 14 +++++--------- .github/workflows/release.yml | 29 ++++++++++++----------------- 4 files changed, 23 insertions(+), 42 deletions(-) diff --git a/.github/workflows/branch.yml b/.github/workflows/branch.yml index fb7012c..424b060 100644 --- a/.github/workflows/branch.yml +++ b/.github/workflows/branch.yml @@ -8,15 +8,7 @@ jobs: runs-on: ubuntu-latest if: github.ref == 'refs/heads/master' steps: - - uses: actions/checkout@v2 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - maven- - if: always() + - uses: actions/checkout@v3 - uses: oleksiyrudenko/gha-git-credentials@v2.1 with: global: true @@ -25,8 +17,8 @@ jobs: token: '${{ secrets.GITHUB_TOKEN }}' - name: Release branch with Maven run: | - VERSION=`mvn help:evaluate -Dexpression=project.version -q -DforceStdout` + VERSION=`mvn help:evaluate -ntp -Dexpression=project.version -q -DforceStdout` RELEASE_VERSION=`echo $VERSION | sed -r 's/-SNAPSHOT/.0-SNAPSHOT/'` DEVELOPMENT_VERSION=`echo $VERSION | gawk 'match($1, /([0-9]+)\.([0-9]+)([\.-])(.*)/, a) {print a[1]"."(a[2]+1)a[3]a[4]}'` - mvn -DupdateBranchVersions=true -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION} release:branch + mvn -ntp -DupdateBranchVersions=true -DreleaseVersion=${RELEASE_VERSION} -DdevelopmentVersion=${DEVELOPMENT_VERSION} release:branch diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index c64b14f..6b0f40d 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -19,10 +19,8 @@ jobs: build: runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: actions/setup-java@v3.6.0 with: distribution: 'temurin' @@ -34,7 +32,7 @@ jobs: gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE - name: Build with Maven - run: mvn -fae -DskipITs=false -DskipTests=${skipTests} -U -B -Pdeploy,sonatype deploy -Dgpg.skip=false + run: mvn -ntp -fae -DskipITs=false -DskipTests=${skipTests} -U -B -Pdeploy,sonatype deploy -Dgpg.skip=false env: SONATYPE_USERNAME: vpro SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} @@ -43,7 +41,7 @@ jobs: uses: codecov/codecov-action@v3 continue-on-error: true - name: Publish Test Report - uses: EnricoMi/publish-unit-test-result-action/composite@v2.2.0 + uses: EnricoMi/publish-unit-test-result-action/composite@v2.3.0 with: junit_files: "**/target/surefire-reports/*.xml" if: always() diff --git a/.github/workflows/pull.yml b/.github/workflows/pull.yml index 385496d..aa1eb01 100644 --- a/.github/workflows/pull.yml +++ b/.github/workflows/pull.yml @@ -3,22 +3,18 @@ name: build pull request on: pull_request: - branches: [master] + branches: [main] jobs: build: - runs-on: ubuntu-latest - env: - MAVEN_OPTS: -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn steps: - - uses: getong/elasticsearch-action@v1.2 - with: - elasticsearch version: '7.6.1' - uses: actions/checkout@v3 - name: Set up JDK uses: actions/setup-java@v3 with: - java-version: 1.8 + distribution: 'temurin' + java-version: 17 + cache: maven - name: Build with Maven - run: mvn -fae -DskipITs=false -Dinteg.cluster.name=docker-elasticsearch -B package + run: mvn -ntp -fae -DskipITs=false -Dinteg.cluster.name=docker-elasticsearch -B package diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d63d962..f369161 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,26 +10,17 @@ jobs: steps: - name: echo run: echo {{ $github.ref }} - - uses: actions/checkout@v2 - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: maven-${{ hashFiles('**/pom.xml') }} - restore-keys: | - maven- + - uses: actions/checkout@v3 - uses: actions/setup-java@v3 with: distribution: 'temurin' - java-version: 11 - - name: Create settings.xml - uses: s4u/maven-settings-action@v2 - with: - servers: '[{"id": "vpro-ossrh", "username": "vpro", "password": "${{secrets.SONATYPE_PASSWORD}}"}]' - - uses: crazy-max/ghaction-import-gpg@v3 - with: + java-version: 17 + cache: maven + server-id: vpro-ossrh + server-username: SONATYPE_USERNAME + server-password: SONATYPE_PASSWORD gpg-private-key: ${{ secrets.GPG_SECRET_KEY }} - passphrase: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }} + gpg-passphrase: GPG_SECRET_KEY_PASSPHRASE - uses: oleksiyrudenko/gha-git-credentials@v2.1 with: global: true @@ -37,4 +28,8 @@ jobs: email: 'digitaal-techniek@vpro.nl' token: '${{ secrets.GITHUB_TOKEN }}' - name: Release - run: mvn -Pdeploy --batch-mode -Darguments=-DskipTests release:prepare release:perform + run: mvn -ntp -Pdeploy --batch-mode -Darguments=-DskipTests release:prepare release:perform + env: + SONATYPE_USERNAME: vpro + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + GPG_SECRET_KEY_PASSPHRASE: ${{ secrets.GPG_SECRET_KEY_PASSPHRASE }}