mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-07-31 17:38:28 +00:00
[ACA-4649] fix lib publishing (#3042)
* [ACA-4649] fix lib publishing * fix cd typo * add safety check for existing tag
This commit is contained in:
21
.github/actions/git-tag/action.yml
vendored
21
.github/actions/git-tag/action.yml
vendored
@@ -25,12 +25,15 @@ runs:
|
|||||||
VERSION=$(jq -cr '.version' < package.json)
|
VERSION=$(jq -cr '.version' < package.json)
|
||||||
echo "git tag -a ${VERSION} -m ${VERSION}"
|
echo "git tag -a ${VERSION} -m ${VERSION}"
|
||||||
|
|
||||||
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
|
if [ $(git tag -l "$VERSION") ]; then
|
||||||
git tag -a ${VERSION} -m "${VERSION} [ci skip] "
|
echo "Tag \"$VERSION\" already exists. Skipping."
|
||||||
git remote rm origin
|
else
|
||||||
GITHUB_REPO=https://${{ inputs.github_token }}:x-oauth-basic@github.com/Alfresco/alfresco-content-app.git
|
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
|
||||||
git remote add origin $GITHUB_REPO
|
git tag -a ${VERSION} -m "${VERSION} [ci skip] "
|
||||||
git push origin --tags
|
git remote rm origin
|
||||||
fi;
|
GITHUB_REPO=https://${{ inputs.github_token }}:x-oauth-basic@github.com/Alfresco/alfresco-content-app.git
|
||||||
|
git remote add origin $GITHUB_REPO
|
||||||
fi;
|
git push origin --tags
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
8
.github/actions/publish-libs/action.yml
vendored
8
.github/actions/publish-libs/action.yml
vendored
@@ -37,10 +37,10 @@ runs:
|
|||||||
run: |
|
run: |
|
||||||
export DIST_DIR=./dist/@alfresco
|
export DIST_DIR=./dist/@alfresco
|
||||||
PROJECTS_DIR=./projects
|
PROJECTS_DIR=./projects
|
||||||
VERSION_IN_PACKAGE_JSON=$(node -p "require('./package.json').version;")
|
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
|
||||||
|
|
||||||
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
||||||
NEW_LIBRARY_VERSION=VERSION_IN_PACKAGE_JSON
|
NEW_LIBRARY_VERSION="$VERSION_IN_PACKAGE_JSON"
|
||||||
else
|
else
|
||||||
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}"
|
NEW_LIBRARY_VERSION="${VERSION_IN_PACKAGE_JSON}-${{ github.run_id }}"
|
||||||
fi
|
fi
|
||||||
@@ -58,9 +58,9 @@ runs:
|
|||||||
);
|
);
|
||||||
|
|
||||||
for PROJECT in "${PROJECTS[@]}"; do
|
for PROJECT in "${PROJECTS[@]}"; do
|
||||||
echo "Update ${PROJECT} version to ${NEW_LIBRARY_VERSION}"
|
echo "Update \"$PROJECT\" to version \"$NEW_LIBRARY_VERSION\""
|
||||||
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
|
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
|
||||||
(cd cd $PROJECTS_DIR/${PROJECT} && npm version --allow-same-version --no-git-tag-version --force ${NEW_LIBRARY_VERSION})
|
(cd $PROJECTS_DIR/${PROJECT} && npm version --allow-same-version --no-git-tag-version --force "$NEW_LIBRARY_VERSION")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user