Skip to content

Release

Release #51

Workflow file for this run

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@8ca2b8b2ece13480cda6dacd3511b49857a23c09 # v2.5.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@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Install Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
cache: npm
node-version-file: .nvmrc
- name: Install dependencies
run: npm clean-install
- name: Create automation token
uses: tibdex/github-app-token@b62528385c34dbc9f38e5f4225ac829252d1ea92 # v1.8.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