Release #35
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
name: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseVersion: | |
description: "Release Version" | |
required: true | |
developmentVersion: | |
description: "Next Development Version" | |
required: true | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
registry-url: "https://registry.npmjs.org" | |
- name: Bump to release version | |
run: | | |
git config user.name flexrouting+ci | |
git config user.email flexrouting+ci@twilio.com | |
yarn version --new-version "${{ github.event.inputs.releaseVersion }}" --no-git-tag-version | |
- run: | | |
yarn | |
yarn build | |
- run: | | |
git add . | |
git add -f dist | |
git commit -m "${{ github.event.inputs.releaseVersion }}" | |
git tag ${{ github.event.inputs.releaseVersion }} | |
git push origin HEAD:main --tags | |
git checkout -B gh-pages | |
find . -mindepth 1 -maxdepth 1 \( -name .gitignore -o -name node_modules -o -name dist -o -name .git \) -prune -o -exec rm -rf {} + | |
mv dist/docs/* . | |
rm -rf dist | |
git add . | |
git commit -am "${{ github.event.inputs.releaseVersion }}" | |
git push origin gh-pages --force | |
git checkout main | |
yarn publish --new-version "${{ github.event.inputs.releaseVersion }}" | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} | |
development: | |
runs-on: ubuntu-latest | |
needs: [release] | |
steps: | |
- uses: actions/checkout@main | |
- uses: actions/setup-node@v1 | |
with: | |
node-version: 12.x | |
- name: Bump version | |
id: bump_version | |
run: | | |
git config user.name flexrouting+ci | |
git config user.email flexrouting+ci@twilio.com | |
git pull origin HEAD:main | |
yarn version --new-version "${{ github.event.inputs.developmentVersion }}" --no-git-tag-version | |
git pull origin HEAD:main | |
git add . | |
git rm -rf dist | |
git commit -m "${{ github.event.inputs.developmentVersion }}" | |
git push origin HEAD:main --force |