This repository has been archived by the owner on Dec 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dotCMS/core#20245 fix automate dotcms-webcomponent lib publish (#1665)
* dotCMS/core#20245 fix automate dotcms-webcomponent lib publish * test * test2 * changed file * changed file * outside file changed * revert * outside change * Clean up - 2021/05/11 12:34 * bump test * bump test * CI: bumps version to v0.0.25-next.0 [skip ci] * bump test * CI: bumps version to v0.0.25-next.1 [skip ci] * bump test * CI: bumps version to v0.0.25-rc.0 [skip ci] * bump test * CI: bumps version to v0.0.25 [skip ci] * bump test; git push; * bump test * bump test * bump test * bump test * bump test * bump test * bump test * clean up and added final bump versions rc and next * clean up * fix dual bump version id * Feedback: removed setting specific version in core of published lib * feedback Co-authored-by: Automated Version Bump <[email protected]>
- Loading branch information
1 parent
b2c1cc5
commit cf277b7
Showing
2 changed files
with
101 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,97 @@ | ||
name: Publish to Dotcms Webcomponents | ||
on: | ||
push: | ||
branches: | ||
- release-* | ||
- master | ||
jobs: | ||
changes: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
dotcms-webcomponents: ${{ steps.filter.outputs.dotcms-webcomponents }} | ||
steps: | ||
- name: Checkout core-web | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
path: 'core-web' | ||
|
||
- name: Get specific changed files | ||
uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
base: ${{ github.ref }} | ||
list-files: 'json' | ||
working-directory: 'core-web' | ||
filters: | | ||
dotcms-webcomponents: | ||
- 'libs/dotcms-webcomponents/**' | ||
- name: Changes found | ||
if: steps.filter.outputs.dotcms-webcomponents == 'true' | ||
run: | | ||
echo "Found Dotcms-webcomponent files changed." | ||
echo ${{ steps.filter.outputs.dotcms-webcomponents_files }} | ||
- name: No changes found | ||
if: steps.filter.outputs.dotcms-webcomponents == 'false' | ||
run: | | ||
echo "No changes found in dotcms-webcomponents" | ||
publish: | ||
needs: changes | ||
if: ${{ needs.changes.outputs.dotcms-webcomponents == 'true' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout core-web | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 1 | ||
path: 'core-web' | ||
- name: Configuring Node.js | ||
uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: '10.15.3' | ||
- name: Installing dependencies | ||
run: | | ||
cd core-web | ||
npm install | ||
- name: 'Automated Version Bump - dotcms-webcomponents - if it is Release branch' | ||
id: version-bump-release | ||
if: ${{contains(github.ref, 'release-')}} | ||
uses: 'phips28/gh-action-bump-version@master' | ||
with: | ||
commit-message: 'CI: bumps version to {{version}} [skip ci]' | ||
skip-tag: 'true' | ||
default: prerelease | ||
preid: 'rc' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PACKAGEJSON_DIR: 'core-web/libs/dotcms-webcomponents' | ||
- name: 'Automated Version Bump - dotcms-webcomponents - if it is Master branch' | ||
id: version-bump-master | ||
if: ${{contains(github.ref, 'master')}} | ||
uses: 'phips28/gh-action-bump-version@master' | ||
with: | ||
commit-message: 'CI: bumps version to {{version}} [skip ci]' | ||
skip-tag: 'true' | ||
default: prerelease | ||
preid: 'next' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
PACKAGEJSON_DIR: 'core-web/libs/dotcms-webcomponents' | ||
- name: Build dotcms-webcomponents with deps | ||
run: | | ||
cd core-web | ||
npm run nx build dotcms-ui -- --with-deps --prod | ||
- name: 'publish to npm' | ||
run: | | ||
cd core-web | ||
npm set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }} | ||
cd dist/libs/dotcms-webcomponents | ||
if [[ $(basename "${{ github.ref }}") =~ ^release-.* ]]; then | ||
npm publish --tag rc | ||
fi | ||
if [[ $(basename "${{ github.ref }}") =~ ^master ]]; then | ||
npm publish --tag next | ||
fi |
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,4 @@ | ||
{ | ||
"name": "dotcms-webcomponents", | ||
"version": "0.0.24" | ||
} |