blob: d55cc4c931b1d049c15e939e9d49231dd105a362 [file]
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you 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 permissions and limitations
# under the License.
name: Snapshot Build
on:
push:
branches: [ develop ]
env:
JAVA_VERSION: 21
PROJECT_NAME: SCIMple
PROJECT_NAME_LOWER: scimple
MAVEN_ARGS: --batch-mode --no-transfer-progress
jobs:
snapshot:
runs-on: ubuntu-latest
outputs:
project-version: ${{ steps.version.outputs.project-version }}
changelog-md: ${{ steps.mvn.outputs.changelog-md }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd #v6.0.2
with:
fetch-depth: 0 # need history to generate the changelog
- name: Set up Java ${{ env.JAVA_VERSION }}-zulu
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 #v5.2.0
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: zulu
cache: maven
server-id: apache.snapshots.https
server-username: NEXUS_USERNAME
server-password: NEXUS_PASSWORD
gpg-private-key: ${{ secrets.GPG_SECRET_KEY }}
- name: Resolve the `project-version` from the pom
id: version
shell: bash
run: |
export PROJECT_VERSION=$(./mvnw --non-recursive --quiet --batch-mode \
-DforceStdout=true \
-Dexpression=project.version \
-Dscan=false \
help:evaluate \
| tail -n 1)
echo "project-version=$PROJECT_VERSION"
echo "project-version=$PROJECT_VERSION" >> $GITHUB_OUTPUT
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.DIRECTORY_DEVELOCITY_ACCESS_KEY }}
- name: Maven Snapshot Build
id: mvn
run: |
./mvnw -V deploy \
-Papache-release -Pci \
--threads=1 \
-Daether.checksums.algorithms=SHA-512,SHA-1,MD5
echo "changelog-md=./target/jreleaser/release/CHANGELOG.md" >> $GITHUB_OUTPUT
env:
NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
NEXUS_PASSWORD: ${{ secrets.NEXUS_PW }}
DEVELOCITY_ACCESS_KEY: ${{ secrets.DIRECTORY_DEVELOCITY_ACCESS_KEY }}
JRELEASER_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Success Summary
shell: bash
run: |
./mvnw -N -Pci-templating resources:copy-resources \
-DgitRef=${{ github.ref_name }}
cat ./target/snapshot-success-summary.md >> $GITHUB_STEP_SUMMARY
cat ${{ steps.mvn.outputs.changelog-md }} >> $GITHUB_STEP_SUMMARY