mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2025-05-12 17:04:46 +00:00
[ACA-4649] release workflow enhancements (#3043)
* move update versions of libs to shell script * unify packaging script * update package.json repository * change github token
This commit is contained in:
parent
0b55af2c32
commit
4933b1db42
86
.github/actions/publish-libs/action.yml
vendored
86
.github/actions/publish-libs/action.yml
vendored
@ -32,11 +32,9 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: update libs version
|
- name: Update Library Versions
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
DIST_DIR="./dist/@alfresco"
|
|
||||||
PROJECTS_DIR="./projects"
|
|
||||||
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
|
VERSION_IN_PACKAGE_JSON=$(jq -cr '.version' < package.json)
|
||||||
|
|
||||||
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
if [[ ${{ inputs.branch_name }} =~ ^master.*?$ ]] ; then
|
||||||
@ -47,97 +45,31 @@ runs:
|
|||||||
|
|
||||||
echo -e "Branch is '${{ inputs.branch_name }}, therefore publish with '${{ inputs.npm_tag }}' tag\n"
|
echo -e "Branch is '${{ inputs.branch_name }}, therefore publish with '${{ inputs.npm_tag }}' tag\n"
|
||||||
|
|
||||||
export PROJECTS=(
|
./scripts/gh/update-lib-versions.sh "$NEW_LIBRARY_VERSION" "${{ inputs.dry-run }}"
|
||||||
'aca-shared'
|
|
||||||
'aca-folder-rules'
|
|
||||||
'adf-office-services-ext'
|
|
||||||
'aca-about'
|
|
||||||
'aca-preview'
|
|
||||||
'aca-viewer'
|
|
||||||
'aca-content'
|
|
||||||
);
|
|
||||||
|
|
||||||
for PROJECT in ${PROJECTS[@]}
|
echo "Building projects"
|
||||||
do
|
|
||||||
echo "Update \"$PROJECT\" to version \"$NEW_LIBRARY_VERSION\""
|
|
||||||
if [[ "${{ inputs.dry-run }}" != "true" ]]; then
|
|
||||||
(cd $PROJECTS_DIR/${PROJECT} && npm version --allow-same-version --no-git-tag-version --force "$NEW_LIBRARY_VERSION")
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
echo -e "\n\nBuild projects"
|
|
||||||
npm run build-libs
|
npm run build-libs
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
name: setup GH registry
|
name: setup GH registry
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: 'https://npm.pkg.github.com'
|
registry-url: 'https://npm.pkg.github.com'
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
- name: publish tag to GH registry
|
- name: Publish to GH registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: ./scripts/gh/npm-publish.sh "${{ inputs.npm_tag }}" "${{ inputs.dry-run }}"
|
||||||
DIST_DIR="./dist/@alfresco"
|
|
||||||
|
|
||||||
export PROJECTS=(
|
|
||||||
'aca-shared'
|
|
||||||
'aca-folder-rules'
|
|
||||||
'adf-office-services-ext'
|
|
||||||
'aca-about'
|
|
||||||
'aca-preview'
|
|
||||||
'aca-viewer'
|
|
||||||
'aca-content'
|
|
||||||
);
|
|
||||||
|
|
||||||
for PROJECT in ${PROJECTS[@]}
|
|
||||||
do
|
|
||||||
cd $DIST_DIR/${PROJECT}
|
|
||||||
|
|
||||||
if [[ "${{ inputs.dry-run }}" == "true" ]]; then
|
|
||||||
echo -e "Publish with dry mode for project to GH registry: $PROJECT\n"
|
|
||||||
echo -e "npm publish --dry-run --tag ${{ inputs.npm_tag }} \n"
|
|
||||||
npm publish --dry-run --tag ${{ inputs.npm_tag }}
|
|
||||||
else
|
|
||||||
echo -e "======== Publishing project to GH registry: $PROJECT ========\n"
|
|
||||||
echo -e "npm publish --tag ${{ inputs.npm_tag }}\n"
|
|
||||||
npm publish --tag ${{ inputs.npm_tag }}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.github_token }}
|
NODE_AUTH_TOKEN: ${{ inputs.github_token }}
|
||||||
|
|
||||||
- uses: actions/setup-node@v3
|
- uses: actions/setup-node@v3
|
||||||
name: setup NPM registry
|
name: setup NPM registry
|
||||||
with:
|
with:
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
registry-url: ${{ inputs.npm_registry_address }}
|
registry-url: ${{ inputs.npm_registry_address }}
|
||||||
scope: '@alfresco'
|
scope: '@alfresco'
|
||||||
- name: publish tag to NPM registry
|
- name: Publish to NPM registry
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: ./scripts/gh/npm-publish.sh "${{ inputs.npm_tag }}" "${{ inputs.dry-run }}"
|
||||||
DIST_DIR="./dist/@alfresco"
|
|
||||||
|
|
||||||
export PROJECTS=(
|
|
||||||
'aca-shared'
|
|
||||||
'aca-folder-rules'
|
|
||||||
'adf-office-services-ext'
|
|
||||||
'aca-about'
|
|
||||||
'aca-preview'
|
|
||||||
'aca-viewer'
|
|
||||||
'aca-content'
|
|
||||||
);
|
|
||||||
|
|
||||||
for PROJECT in ${PROJECTS[@]}
|
|
||||||
do
|
|
||||||
cd $DIST_DIR/${PROJECT}
|
|
||||||
|
|
||||||
if [[ "${{ inputs.dry-run }}" == "true" ]]; then
|
|
||||||
echo -e "Publish with dry mode for project to NPM registry: $PROJECT\n"
|
|
||||||
echo -e "npm publish --dry-run --tag ${{ inputs.npm_tag }} \n"
|
|
||||||
npm publish --dry-run --tag ${{ inputs.npm_tag }}
|
|
||||||
else
|
|
||||||
echo -e "======== Publishing project to NPM registry: $PROJECT ========\n"
|
|
||||||
echo -e "npm publish --tag ${{ inputs.npm_tag }}\n"
|
|
||||||
npm publish --tag ${{ inputs.npm_tag }}
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ inputs.npm_registry_token }}
|
NODE_AUTH_TOKEN: ${{ inputs.npm_registry_token }}
|
||||||
|
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@ -136,7 +136,7 @@ jobs:
|
|||||||
uses: ./.github/actions/publish-libs
|
uses: ./.github/actions/publish-libs
|
||||||
with:
|
with:
|
||||||
branch_name: ${{ env.BRANCH_NAME }}
|
branch_name: ${{ env.BRANCH_NAME }}
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.BOT_GITHUB_TOKEN }}
|
||||||
npm_registry_address: ${{ vars.NPM_REGISTRY_ADDRESS }}
|
npm_registry_address: ${{ vars.NPM_REGISTRY_ADDRESS }}
|
||||||
npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
npm_registry_token: ${{ secrets.NPM_REGISTRY_TOKEN }}
|
||||||
npm_tag: ${{ env.TAG_NPM }}
|
npm_tag: ${{ env.TAG_NPM }}
|
||||||
|
@ -25,6 +25,10 @@
|
|||||||
"inspect.bundle": "ng build content-ce --configuration production --stats-json && npx webpack-bundle-analyzer dist/content-ce/stats.json",
|
"inspect.bundle": "ng build content-ce --configuration production --stats-json && npx webpack-bundle-analyzer dist/content-ce/stats.json",
|
||||||
"prepare": "husky install"
|
"prepare": "husky install"
|
||||||
},
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/Alfresco/alfresco-content-app.git"
|
||||||
|
},
|
||||||
"private": true,
|
"private": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@alfresco/adf-content-services": "6.0.0-A.3",
|
"@alfresco/adf-content-services": "6.0.0-A.3",
|
||||||
|
34
scripts/gh/npm-publish.sh
Executable file
34
scripts/gh/npm-publish.sh
Executable file
@ -0,0 +1,34 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
|
||||||
|
DIST_DIR="$ROOT_DIR/dist/@alfresco"
|
||||||
|
TAG=$1
|
||||||
|
DRY_RUN=$2
|
||||||
|
|
||||||
|
if [[ -z "$TAG" ]]; then
|
||||||
|
echo "Missing tag parameter"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PROJECTS=(
|
||||||
|
'aca-about'
|
||||||
|
'aca-content'
|
||||||
|
'aca-folder-rules'
|
||||||
|
'adf-office-services-ext'
|
||||||
|
'aca-preview'
|
||||||
|
'aca-shared'
|
||||||
|
'aca-viewer'
|
||||||
|
);
|
||||||
|
|
||||||
|
for PROJECT in ${PROJECTS[@]}
|
||||||
|
do
|
||||||
|
cd $DIST_DIR/$PROJECT
|
||||||
|
|
||||||
|
if [[ "$DRY_RUN" == "true" ]]; then
|
||||||
|
echo "[DRY RUN] Publishing \"$PROJECT\" with \"$TAG\" tag"
|
||||||
|
npm publish --dry-run --tag "$TAG"
|
||||||
|
else
|
||||||
|
echo "Publishing \"$PROJECT\" with \"$TAG\" tag"
|
||||||
|
npm publish --tag "$TAG"
|
||||||
|
fi
|
||||||
|
done
|
31
scripts/gh/update-lib-versions.sh
Executable file
31
scripts/gh/update-lib-versions.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../.." && pwd )"
|
||||||
|
VERSION=$1
|
||||||
|
DRY_RUN=$2
|
||||||
|
|
||||||
|
if [[ -z "$VERSION" ]]; then
|
||||||
|
echo "Missing version parameter"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
export PROJECTS=(
|
||||||
|
'aca-about'
|
||||||
|
'aca-content'
|
||||||
|
'aca-folder-rules'
|
||||||
|
'adf-office-services-ext'
|
||||||
|
'aca-preview'
|
||||||
|
'aca-shared'
|
||||||
|
'aca-viewer'
|
||||||
|
);
|
||||||
|
|
||||||
|
for PROJECT in ${PROJECTS[@]}
|
||||||
|
do
|
||||||
|
echo "Updating \"$PROJECT\" to version \"$VERSION\""
|
||||||
|
|
||||||
|
if [[ "$DRY_RUN" != "true" ]]; then
|
||||||
|
PROJECT_DIR=$ROOT_DIR/projects/$PROJECT
|
||||||
|
|
||||||
|
(cd $PROJECT_DIR && npm version --allow-same-version --no-git-tag-version --force "$VERSION")
|
||||||
|
fi
|
||||||
|
done
|
Loading…
x
Reference in New Issue
Block a user