Skip to content

Merge pull request #754 from apache/ci-scripts #15

Merge pull request #754 from apache/ci-scripts

Merge pull request #754 from apache/ci-scripts #15

Workflow file for this run

# 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@v4
with:
fetch-depth: 0 # need history to generate the changelog
- name: Set up Java ${{ env.JAVA_VERSION }}-zulu
uses: actions/setup-java@v4
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 \
help:evaluate \
| tail -n 1)
echo "project-version=$PROJECT_VERSION"
echo "project-version=$PROJECT_VERSION" >> $GITHUB_OUTPUT
env:
DEVELOCITY_ACCESS_KEY: ${{ secrets.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 \
-Ddevelocity.cache.local.enabled=false \
-Ddevelocity.cache.remote.enabled=false
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.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