.github/workflows/prepare-next-release.yml #81
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
on: | |
push: | |
tags: | |
- '[0-9]+.[0-9]+.[0-9]+' | |
- '[0-9]+.[0-9]+.[0-9]+-mock' | |
jobs: | |
load-release-info: | |
runs-on: ubuntu-latest | |
outputs: | |
branch: ${{ steps.load-descriptor.outputs.branch }} | |
version: ${{ steps.load-descriptor.outputs.version }} | |
next-version: ${{ steps.load-descriptor.outputs.next-version }} | |
mock: ${{ steps.load-descriptor.outputs.mock }} | |
staging-repository: ${{ steps.load-descriptor.outputs.staging-repository }} | |
steps: | |
- name: Installing activiti-scripts | |
uses: actions/checkout@v3 | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
id: load-descriptor | |
with: | |
release-descriptor: release.yaml | |
maven-update-main-branch-to-next-version: | |
runs-on: ubuntu-latest | |
needs: [ load-release-info ] | |
strategy: | |
fail-fast: true | |
matrix: | |
repo: [ 'Activiti','activiti-cloud' ] | |
env: | |
NEXT_VERSION: ${{ needs.load-release-info.outputs.next-version }} | |
REPO_DIR: repos/${{ matrix.repo }} | |
BRANCH: ${{ needs.load-release-info.outputs.branch }} | |
steps: | |
- name: Checkout ${{ matrix.repo }} | |
uses: actions/checkout@v3 | |
with: | |
repository: Activiti/${{ matrix.repo }} | |
path: ${{ env.REPO_DIR }} | |
ref: ${{ env.BRANCH }} | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: update-to-next-version | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
version: ${{ env.NEXT_VERSION }} | |
repository-directory: repos/${{ matrix.repo }} | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
username: ${{ secrets.BOT_GITHUB_USERNAME }} | |
add-options: -u | |
commit-message: Update to version ${{ env.NEXT_VERSION}} [skip ci] | |
repository-directory: ${{ env.REPO_DIR }} | |
- name: Push changes to branch ${{ env.BRANCH }} | |
if: needs.load-release-info.outputs.mock == 'false' | |
working-directory: ${{ env.REPO_DIR }} | |
run: git push origin "$BRANCH" | |
helm-update-main-branch-to-next-version: | |
runs-on: ubuntu-latest | |
needs: [ load-release-info ] | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- repo: activiti-cloud-common-chart | |
chart-dir: charts/common | |
- repo: activiti-cloud-full-chart | |
chart-dir: charts/activiti-cloud-full-example | |
env: | |
NEXT_VERSION: ${{ needs.load-release-info.outputs.next-version }} | |
REPO_DIR: repos/${{ matrix.repo }} | |
BRANCH: ${{ needs.load-release-info.outputs.branch }} | |
steps: | |
- name: Checkout ${{ matrix.repo }} | |
uses: actions/checkout@v3 | |
with: | |
repository: Activiti/${{ matrix.repo }} | |
path: ${{ env.REPO_DIR }} | |
ref: ${{ env.BRANCH }} | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: Update branch '${{env.BRANCH}}' to the next version | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
new-version: ${{ env.NEXT_VERSION }} | |
chart-repository-dir: ${{ env.REPO_DIR }} | |
chart-dir: ${{ matrix.chart-dir }} | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
username: ${{ secrets.BOT_GITHUB_USERNAME }} | |
add-options: -u | |
commit-message: Update to version ${{ env.NEXT_VERSION}} [skip ci] | |
repository-directory: ${{ env.REPO_DIR }} | |
- name: Push changes to branch ${{ env.BRANCH }} | |
if: needs.load-release-info.outputs.mock == 'false' | |
working-directory: ${{ env.REPO_DIR }} | |
run: git push origin "$BRANCH" | |
maven-create-maintenance-branch: | |
if: endsWith(needs.load-release-info.outputs.version, '.0') || contains(needs.load-release-info.outputs.version, '.0-mock') | |
runs-on: ubuntu-latest | |
needs: [ load-release-info ] | |
strategy: | |
fail-fast: true | |
matrix: | |
repo: [ 'Activiti','activiti-cloud' ] | |
env: | |
REPO_DIR: repos/${{ matrix.repo }} | |
TAG: ${{ needs.load-release-info.outputs.version }} | |
steps: | |
- name: Checkout activiti-scripts | |
uses: actions/checkout@v3 | |
- name: Checkout ${{ matrix.repo }} | |
uses: actions/checkout@v3 | |
with: | |
repository: Activiti/${{ matrix.repo }} | |
path: ${{ env.REPO_DIR }} | |
ref: ${{ env.TAG }} | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: Create maintenance branch if needed | |
id: create-maintenance-branch | |
uses: ./.github/actions/create-maintenance-branch | |
with: | |
working-directory: ${{ env.REPO_DIR }} | |
tag: ${{ env.TAG }} | |
- name: Set up JDK 11 | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
uses: actions/setup-java@v3 | |
with: | |
distribution: temurin | |
java-version: 11 | |
cache: 'maven' | |
- name: Configure Maven settings | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
shell: bash | |
env: | |
MAVEN_SETTINGS_PATH: ${{ github.workspace }}/maven-config/settings.xml | |
run: | | |
M2_DIR=$HOME/.m2 | |
cp $MAVEN_SETTINGS_PATH $M2_DIR | |
ls $M2_DIR | |
cat $M2_DIR/settings.xml | |
- name: update-to-next-version | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
env: | |
NEXUS_URL: "https://artifacts.alfresco.com/nexus" | |
STAGING_REPOSITORY_ID: ${{ needs.load-release-info.outputs.staging-repository }} | |
NEXUS_USERNAME: "${{ secrets.NEXUS_USERNAME }}" | |
NEXUS_PASSWORD: "${{ secrets.NEXUS_PASSWORD }}" | |
VERSION: ${{ steps.create-maintenance-branch.outputs.version }} | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
with: | |
version: ${{ env.VERSION }} | |
repository-directory: ${{ env.REPO_DIR }} | |
- name: Update configuration files | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
uses: ./.github/actions/update-ci-branch | |
with: | |
repo-path: ${{ env.REPO_DIR }} | |
branch: ${{ steps.create-maintenance-branch.outputs.branch }} | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
with: | |
username: ${{ secrets.BOT_GITHUB_USERNAME }} | |
add-options: -u | |
commit-message: Update to version ${{ steps.create-maintenance-branch.outputs.version }} [skip ci] | |
repository-directory: ${{ env.REPO_DIR }} | |
- name: Push changes to branch ${{ env.BRANCH }} | |
if: ${{ steps.create-maintenance-branch.outputs.exists == 'false' && needs.load-release-info.outputs.mock == 'false' }} | |
working-directory: ${{ env.REPO_DIR }} | |
env: | |
BRANCH: ${{ steps.create-maintenance-branch.outputs.branch }} | |
run: git push origin "$BRANCH" | |
helm-create-maintenance-branch: | |
if: endsWith(needs.load-release-info.outputs.version, '.0') || contains(needs.load-release-info.outputs.version, '.0-mock') | |
runs-on: ubuntu-latest | |
needs: [ load-release-info ] | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
- repo: activiti-cloud-common-chart | |
chart-dir: charts/common | |
- repo: activiti-cloud-full-chart | |
chart-dir: charts/activiti-cloud-full-example | |
env: | |
REPO_DIR: repos/${{ matrix.repo }} | |
TAG: ${{ needs.load-release-info.outputs.version }} | |
steps: | |
- name: Checkout activiti-scripts | |
uses: actions/checkout@v3 | |
- name: Checkout ${{ matrix.repo }} | |
uses: actions/checkout@v3 | |
with: | |
repository: Activiti/${{ matrix.repo }} | |
path: ${{ env.REPO_DIR }} | |
ref: ${{ env.TAG }} | |
token: ${{ secrets.BOT_GITHUB_TOKEN }} | |
- name: Create maintenance branch if needed | |
id: create-maintenance-branch | |
uses: ./.github/actions/create-maintenance-branch | |
with: | |
working-directory: ${{ env.REPO_DIR }} | |
tag: ${{ env.TAG }} | |
- name: Update maintenance branch '${{env.BRANCH}}' to ${{ env.VERSION }} version | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
env: | |
BRANCH: ${{steps.create-maintenance-branch.outputs.branch}} | |
VERSION: ${{ steps.create-maintenance-branch.outputs.version }} | |
with: | |
new-version: ${{ env.VERSION }} | |
chart-repository-dir: ${{ env.REPO_DIR }} | |
chart-dir: ${{ matrix.chart-dir }} | |
- name: Update configuration files | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
uses: ./.github/actions/update-ci-branch | |
with: | |
repo-path: ${{ env.REPO_DIR }} | |
branch: ${{ steps.create-maintenance-branch.outputs.branch }} | |
- uses: Alfresco/alfresco-build-tools/.github/actions/[email protected] | |
if: steps.create-maintenance-branch.outputs.exists == 'false' | |
with: | |
username: ${{ secrets.BOT_GITHUB_USERNAME }} | |
add-options: -u | |
commit-message: Update to version ${{ steps.create-maintenance-branch.outputs.version }} [skip ci] | |
repository-directory: ${{ env.REPO_DIR }} | |
- name: Push changes to branch ${{ env.BRANCH }} | |
if: ${{ steps.create-maintenance-branch.outputs.exists == 'false' && needs.load-release-info.outputs.mock == 'false' }} | |
working-directory: ${{ env.REPO_DIR }} | |
env: | |
BRANCH: ${{ steps.create-maintenance-branch.outputs.branch }} | |
run: git push origin "$BRANCH" |