OpenPj is executing Create Release Branch #24
Workflow file for this run
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
# 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: Create Release Candidate | |
run-name: ${{ github.actor }} is executing Create Release Branch | |
permissions: | |
contents: write | |
on: | |
push: | |
workflow_dispatch: | |
inputs: | |
releasecandidatetag: | |
description: 'Release Candidate Tag' | |
default: 'RC0' | |
required: true | |
jobs: | |
createReleaseCandidate: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Init Release Candidate workflow | |
run: echo "Starting Apache ManifoldCF workflow for building ${{ github.event.inputs.releasecandidatetag }}" | |
- uses: actions/checkout@v4.1.1 | |
- name: Set up OpenJDK 11 Temurin x64 | |
uses: actions/setup-java@v4.0.0 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
architecture: x64 | |
cache: maven | |
- name: Get Maven POM version | |
id: mavenProjectVersion | |
run: echo "version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT | |
- name: Initialize mandatory git config | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
git config user.name "$(gh api /users/${GITHUB_ACTOR} | jq .name -r)" | |
git config user.email ${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com | |
- name: Create Branch Version | |
id: branchVersion | |
run: | | |
currentMavenVersion="${{ steps.mavenProjectVersion.outputs.version }}" | |
suffixToRemove="SNAPSHOT" | |
branchVersion=${currentMavenVersion%"$suffixToRemove"} | |
echo "version=${branchVersion}" >> $GITHUB_OUTPUT | |
- name: Set Branch Tag output | |
id: branchTag | |
run: echo "tag=${{ steps.branchVersion.outputs.version }}${{ github.event.inputs.releasecandidatetag }}" >> $GITHUB_OUTPUT | |
- name: Create new release candidate branch | |
run: | | |
git branch ${{ steps.branchTag.outputs.tag }} | |
git push --set-upstream origin ${{ steps.branchTag.outputs.tag }} | |
git checkout ${{ steps.branchTag.outputs.tag }} | |
#- name: Checkout the new branch ${{ steps.branchTag.outputs.tag }} | |
# uses: actions/checkout@v4.1.1 | |
# with: | |
# ref: '${{ steps.branchTag.outputs.tag }}' | |
- name: Update all the Maven modules with the new version | |
run: mvn versions:set -DnewVersion=${{ steps.mavenProjectVersion.outputs.version }} -DremoveSnapshot -DgenerateBackupPoms=false | |
- name: Update Ant script with the new RC version | |
run: sed -i 's/${{ steps.mavenProjectVersion.outputs.version }}-dev/${{ steps.mavenProjectVersion.outputs.version }}/g' build.xml; | |
- name: Update CHANGES.txt | |
run: sed -i 's/${{ steps.mavenProjectVersion.outputs.version }}-dev/Release ${{ steps.mavenProjectVersion.outputs.version }}/g' CHANGES.txt; | |
- name: Ant Build | |
run: ant make-core-deps make-deps image | |
- name: Maven Build | |
run: mvn clean install -DskipTests -DskipITs | |
- name: RAT licence checks | |
run: mvn -pl . apache-rat:check | |
- name: Generate RAT License Report | |
if: always() | |
run: | | |
echo -e "Printing RAT report\n" | |
cat target/rat.txt || true | |
- name: Commit and Push | |
run: | | |
find . -name 'pom.xml' -exec git add {} \; | |
git add CHANGES.txt build.xml | |
git commit -am "New branch for release candidate ${{ steps.branchTag.outputs.tag }} created" | |
git push | |
- name: Set Artifact version output | |
id: artifactVersion | |
run: echo "version=${{ steps.branchVersion.outputs.version }}dev" >> $GITHUB_OUTPUT | |
- name: Upload artifacts - Binary - zip format | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-bin.zip | |
path: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-bin.zip | |
- name: Upload artifacts - Lib - tar.gz format | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-lib.tar.gz | |
path: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-lib.tar.gz | |
- name: Upload artifacts - Lib - zip format | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-lib.zip | |
path: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-lib.zip | |
- name: Upload artifacts - Source code - tar.gz format | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-src.tar.gz | |
path: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-src-tar.gz | |
- name: Upload artifacts - Source code - zip format | |
uses: actions/upload-artifact@v4.3.1 | |
with: | |
name: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-src.zip | |
path: apache-manifoldcf-${{ steps.artifactVersion.outputs.version }}-src-zip | |