Release #53
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: | |
update_type: | |
description: Update type | |
required: true | |
type: choice | |
options: | |
- patch | |
- minor | |
- major | |
permissions: read-all | |
jobs: | |
initiate: | |
name: Initiate | |
runs-on: ubuntu-22.04 | |
permissions: | |
contents: write # To push a commit | |
pull-requests: write # To open a Pull Request | |
steps: | |
- name: Harden runner | |
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
actions-results-receiver-production.githubapp.com:443 | |
api.github.com:443 | |
artifactcache.actions.githubusercontent.com:443 | |
github.com:443 | |
gitlab.com:443 | |
nodejs.org:443 | |
objects.githubusercontent.com:443 | |
registry.npmjs.org:443 | |
- name: Checkout repository | |
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0 | |
- name: Install Node.js | |
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0 | |
with: | |
cache: npm | |
node-version-file: .nvmrc | |
- name: Install dependencies | |
run: npm clean-install | |
- name: Create automation token | |
uses: tibdex/github-app-token@3beb63f4bd073e61482598c45c71c1019b59b73a # v2.1.0 | |
id: automation-token | |
with: | |
app_id: ${{ secrets.AUTOMATION_APP_ID }} | |
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }} | |
- name: Bump version | |
env: | |
UPDATE_TYPE: ${{ github.event.inputs.update_type }} | |
run: npm version "$UPDATE_TYPE" --no-git-tag-version | |
- name: Update index.js | |
run: node script/release/bump-jsdoc.js | |
- name: Update CHANGELOG | |
run: node script/release/bump-changelog.js | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2 | |
with: | |
token: ${{ steps.automation-token.outputs.token }} | |
title: New ${{ github.event.inputs.update_type }} release | |
body: | | |
_This Pull Request was created automatically_ | |
--- | |
### Merge checklist | |
- [ ] All continuous integration checks passed. | |
- [ ] The version number is consistently updated in `package.json`, `package-lock.json`, and `index.js`. | |
- [ ] A new release is added to `CHANGELOG.md` with the correct version number and date. | |
- [ ] The new version number is in accordance with [Semantic Versioning]. | |
- [ ] There are no unexpected changes in the Pull Request. | |
### Post-merge checklist | |
_It will take a few minutes for this to happen._ | |
- [ ] The new version is published to [npm]. | |
- [ ] A git tag for the new release is created. | |
- [ ] A GitHub release is created. | |
- [ ] The major version branch is updated. | |
[npm]: https://www.npmjs.com/package/shescape | |
[semantic versioning]: https://semver.org/spec/v2.0.0.html | |
branch: release-${{ github.event.inputs.update_type }} | |
branch-suffix: random | |
commit-message: Version bump |