Plugins Release Target #9
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
name: Plugins Release Target | |
on: | |
repository_dispatch: | |
types: [on-plugins-release] | |
workflow_dispatch: | |
inputs: | |
release_version: | |
description: 'Release Version (yy.mm.dd[_lts_v##]])' | |
required: false | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v4 | |
with: | |
ref: master | |
fetch-depth: 0 | |
- name: Setup Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- name: Create Release Branch | |
id: create-release-branch | |
run: | | |
release_version="${{ github.event.inputs.release_version }}" | |
[[ -z "${release_version}" ]] && release_version=${{ github.event.client_payload.release_version }} | |
release_branch=release-${release_version} | |
git config user.name "${{ secrets.CI_MACHINE_USER }}" | |
git config user.email "[email protected]" | |
git config pull.rebase false | |
remote=$(git ls-remote --heads https://github.com/dotCMS/plugin-seeds.git ${release_branch} | wc -l | tr -d '[:space:]') | |
if [[ "${remote}" == '1' && "${release_branch}" != 'master' ]]; then | |
echo "Release branch ${release_branch} already exists, removing it" | |
git push origin :${release_branch} | |
fi | |
git checkout -b ${release_branch} | |
for file in $(find . -name pom.xml) | |
do | |
echo "Replacing version for ${file}" | |
python3 ${{ github.workspace }}/update_osgi_plugins.py ${file} ${release_version} | |
cat ${file} | grep "${release_version}" | |
done | |
git status | |
git commit -a -m "Updating dotcms version to ${release_version}" | |
git push origin ${release_branch} |