Skip to content

Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.5 to 3.2.6 #371

Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.5 to 3.2.6

Bump org.apache.maven.plugins:maven-gpg-plugin from 3.2.5 to 3.2.6 #371

Workflow file for this run

# Copyright 2018-2024 Volkan Yazıcı <[email protected]>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permits and
# limitations under the License.
name: build
on:
push:
# Avoid workflow run for _merged_ `dependabot` PRs.
# They were (hopefully!) already tested in PR-triggered workflow.
branches-ignore: "dependabot/**"
pull_request:
paths-ignore:
- "**.adoc"
- "**.md"
- "**.txt"
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest, ubuntu-latest, windows-latest ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-package: jdk
architecture: x64
cache: maven
- name: Build with Maven
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-DtrimStackTrace=false \
-DskipTests=true \
verify
- name: Test scheduler shutdown
timeout-minutes: 1
# pwsh (the default shell on Windows) hijacks "exec" keyword
shell: bash
run: |
./mvnw \
--show-version --batch-mode --errors --no-transfer-progress \
-Dexec.classpathScope=test \
-Dexec.mainClass=com.vlkan.rfos.SchedulerShutdownTestApp \
exec:java
merge:
runs-on: ubuntu-latest
needs: build
steps:
- name: "[dependabot] Fetch metadata"
id: metadata
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
uses: dependabot/[email protected]
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: "[dependabot] Auto-merge the PR"
if: github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'
run: gh pr merge --auto --squash "$PR_URL"
env:
PR_URL: ${{ github.event.pull_request.html_url }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
runs-on: ubuntu-latest
needs: merge
if: github.repository == 'vy/rotating-fos' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/'))
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup JDK 8
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
java-package: jdk
architecture: x64
cache: maven
- name: Import GPG private key
run: |
echo -n "$GPG_PKEY" \
| base64 --decode \
| gpg -v --batch --import --yes --pinentry-mode error
env:
GPG_PKEY: ${{ secrets.GPG_PKEY }}
- name: Export artifact version
run: |
./mvnw \
--quiet --batch-mode -DforceStdout=true \
-Dexpression=project.version \
help:evaluate \
| tee /tmp/mvnw-project-version.out
- name: Check version (SNAPSHOT)
if: github.ref == 'refs/heads/master'
run: |
export REVISION=$(</tmp/mvnw-project-version.out)
[[ "$REVISION" =~ ^[0-9]+\.[0-9]+\.[0-9]+-SNAPSHOT$ ]] || {
echo "was expecting a snapshot version, found: $REVISION" 1>&2
exit 1
}
- name: Check version (RELEASE)
if: startsWith(github.ref, 'refs/heads/release/')
run: |
export REVISION=$(</tmp/mvnw-project-version.out)
[[ "${GITHUB_REF/refs\/heads\/release\//}" == "$REVISION" ]] || {
echo "git ref \"$GITHUB_REF\" mismatches with the version: \"$REVISION\"" 1>&2
exit 1
}
[[ "$REVISION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || {
echo "was expecting a release version, found: \"$REVISION\"" 1>&2
exit 1
}
export CHANGELOG_VERSION=$(grep "^### " CHANGELOG.md | head -n 1 | sed -r 's/^### \(.*\) v(.*)$/\1/')
[[ "$REVISION" == "$CHANGELOG_VERSION" ]] || {
echo "version \"$REVISION\" doesn't match the one in the CHANGELOG: \"$CHANGELOG_VERSION\"" 1>&2
exit 1
}
export CURRENT_DATE=$(date +%Y-%m-%d)
export CHANGELOG_DATE=$(grep "^### " CHANGELOG.md | head -n 1 | sed -r 's/^### \((.*)\) v.*$/\1/')
[[ "$CURRENT_DATE" == "$CHANGELOG_DATE" ]] || {
echo "current date \"$CURRENT_DATE\" doesn't match the one in the CHANGELOG: \"$CHANGELOG_DATE\"" 1>&2
exit 1
}
- name: Deploy
# "package" phase is necessary before "gpg:sign" goal.
run: |
./mvnw \
-V -B --no-transfer-progress -e \
-DskipTests=true \
-DperformRelease=true \
-DdeployAtEnd=true \
--settings .github/maven-settings.xml \
package gpg:sign install:install deploy:deploy
env:
GPG_PKEY_ID: ${{ secrets.GPG_PKEY_ID }}
GPG_PKEY_PASS: ${{ secrets.GPG_PKEY_PASS }}
NEXUS_USER: ${{ secrets.NEXUS_USER }}
NEXUS_PASS: ${{ secrets.NEXUS_PASS }}
- name: Tag version (RELEASE)
if: startsWith(github.ref, 'refs/heads/release/')
run: |
export REVISION=$(</tmp/mvnw-project-version.out)
export TAG="v$REVISION"
git config user.name github-actions
git config user.email [email protected]
git tag "$TAG"
git push origin "$TAG"