Release #55
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@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.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@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4 | |
- 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 src/modules/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@6d6857d36972b65feb161a90e484f2984215f83e # v6.0.5 | |
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 `src/modules/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 |