Release Tag, Docs, & Storybook Updates

    I. Get the latest from master locally, clean up

    1. git status
      1. Check where you are
    2. git checkout master && git fetch origin && git pull origin
      1. Grab master from origin
    3. npm run clean
      1. Wipes node_modules directory and deletes any components not in master
      2. what this does:
      3. rm -rf node_modules package-lock.json
      4. rm -rf node_modules
    4. git reset --hard && git clean -df
      1. Remove any non-committed files, crufty directories
    5. npm install
      1. Installs all dependencies fresh
    6. git checkout -b temp
      1. Create temp branch

    III. Update (changelog_) _and docs

    1. git log --oneline --decorate --no-merges v$(node -e 'console.log(require("./lerna.json").version)')..
      1. See the diffs of what was merged between now & the last release
      2. Or look at PR merged list with “last-updated” sort order:
    2. Update the file and save
    3. Search for release tag string in /docs/layout directory i.e. “prerelease.19” and update to release number

    1. git add * && git commit -m "chore(bump): bump version in docs"
      1. Commit changes, don’t push

    IV. Create release branch & tag

    1. npm run release

      This script will do the following:

      1. Create release branch
      2. Create compiled assets and commit them
      3. Uses lerna to guess at what the next release will be
        1. Choose “custom prerelease” (for now)
        2. It bumps the version numbers inside the package.json files in the components (currently all components are bumped, will fix)
      4. Pushes the branch
      5. Pushes independent tags for each component and pushes to NPM
      6. Remove compiled assets
      7. Returns you to the master branch

    V. Github Updates

    1. Create a PR
    2. Get someone to review
    3. Merge the release branch pull request into master. Note: this must be a regular merge. Do not squash!
    4. Add release notes to the tag in Github

    VI. Deploy storybook & docs (must do this after PR is merged)

    1. git checkout master && git fetch origin && git pull origin
      1. Grab the latest from master, which now has the new release
    2. npm run build
    3. Need to test the docs first?
      1. cd /docs
      2. hugo server
    4. npm run deploy-docs
      1. Create compiled assets
      2. Builds & deploys storybook to
      3. Deploys docs to github pages
        1. (use incognito to check & see if version number is bumped)

    VII. Send email

    There is a new release tag for PatternFly Elements,  [v1.0.0-prerelease.36](, which includes
    *  You can preview the new components on the [storybook demo page.](  
    … other details
    Thanks for your continued support of the project!  #usetheplatform

    (Legacy) The Hard Way

    Before the release script (above) was created, we published releases using the manual steps below. They’re kept here mostly for posterity, and possibly to make the release script more understandable.

    To roll a new release, use the following steps:

    1. Start in the root directory of the patternfly-elements project.
    2. Check out the master branch and pull down the latest:
      • git reset --hard && git clean -df && git checkout master && git fetch origin && git pull
    3. To have lerna bump the verions, run: npm run lerna version -- --no-git-tag-version --no-push --preid prerelease.
      • Choose the appropriate version bump type for the release you’re publishing:
        • if bumping a prerelease version (example: from 1.0.0-prerelease.2 to 1.0.0-prerelease.3), choose Custom Prerelease
    4. Assign that version to this variable for use below: $NEW_VERSION="1.0.0-prerelease.3".
    5. Create a new branch: git checkout -b release/$NEW_VERSION (example: release/1.0.0-prerelease.3).
    6. Run a fresh install, build all the assets, and then force add those assets for the tag release:
      • npm install && npm run build && git add elements/*/*.{js,map,css} -f
    7. Commit the updates: git commit -am "$NEW_VERSION"
    8. Roll the tag: git tag "v$NEW_VERSION"
    9. Remove the bundle files:
      • for e in elements/*; do find $e -maxdepth 1 \( -not -name "gulpfile.js" -not -name "rollup.config.js" \) \( -name "*.js" -or -name "*.css" -or -name "*.map" \) -exec git rm -f {} \; ;done
    10. Commit: git commit -am "Remove bundles from $NEW_VERSION"
    11. Push up to origin: git push origin release/$NEW_VERSION -u
    12. Push up the tag: git push --tags
    13. Checkout master and reset:
      • git checkout master
      • git reset --hard origin/master
    14. Create a pull request for the branch you just created.
    15. Delete branch after merging pull request:
      • git branch -D release/$NEW_VERSION
    16. To publish to npm (you will have to have the right credentials to do this):
      • Checkout the tag release you just rolled: git checkout v$NEW_VERSION
      • From that code, run the lerna publishing task: npm run lerna publish from-git