-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release-24.05.13-ma…
…ven-java-21, resolve conflicts
- Loading branch information
Showing
2 changed files
with
66 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
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 build.gradle) | ||
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} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import sys | ||
import re | ||
|
||
plugin_file = sys.argv[1] | ||
replacing_text = sys.argv[2] | ||
|
||
with open(plugin_file, 'r') as fr: | ||
content = fr.read() | ||
content_new = re.sub('com.dotcms:dotcms:\d{2}\.\d{2}((\.\d{1,2})*)', 'com.dotcms:dotcms:' + replacing_text, content, flags = re.M) | ||
content_new = re.sub('name: \'dotcms\', version: \'\d{2}\.\d{2}((\.\d{1,2})*)\'', 'name: \'dotcms\', version: \'' + replacing_text + '\'', content_new, flags = re.M) | ||
fr.close() | ||
|
||
with open(plugin_file, 'w') as fw: | ||
fw.write(content_new) | ||
fw.close() |