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 management' | |
on: | |
workflow_run: | |
workflows: ['Run tests'] | |
types: | |
- completed | |
branches: '[0-9]+.[0-9]+.[0-9]+' | |
jobs: | |
changelog: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set git user info | |
run: | | |
git config user.name 'Temeraire' | |
git config user.email '[email protected]' | |
- name: Generate a complete changelog | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: -v --no-exec --github-repo ${{ github.repository }} | |
env: | |
OUTPUT: CHANGELOG.md | |
- name: Commit changelog | |
run: | | |
git checkout main | |
git config user.name 'Temeraire' | |
git config user.email '[email protected]' | |
git add CHANGELOG.md | |
git commit -m "docs(changelog.md): update" | |
git push "https://${{ secrets.GITHUB_TOKEN }}@github.com/${GITHUB_REPOSITORY}.git" main | |
- name: Generate a changelog for the latest release | |
uses: orhun/git-cliff-action@v4 | |
with: | |
config: cliff.toml | |
args: -v --no-exec --github-repo ${{ github.repository }} --latest --strip header | |
env: | |
GITHUB_REPO: ${{ github.repository }} | |
OUTPUT: CHANGES.md | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
body_path: CHANGES.md | |
fail_on_unmatched_files: true | |
token: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 22 | |
cache: 'pnpm' | |
- name: Install dependencies | |
run: pnpm install --frozen-lockfile | |
- name: Install dependencies | |
run: pnpm build | |
- name: Publish to NPM | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
run: pnpm publish |