Skip to content

Commit

Permalink
Refactor to replace changelog-to-github-release script with GitHub …
Browse files Browse the repository at this point in the history
…Action (#7112)

This change has the following benefits:
- it can reduce dependencies used in the script
- it can make the GitHub Action share with other repositories

See https://github.com/ybiquitous/changelog-to-github-release-action
  • Loading branch information
ybiquitous committed Jul 29, 2023
1 parent a14ffb2 commit 247c94c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 50 deletions.
33 changes: 11 additions & 22 deletions .github/workflows/preparing-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,33 +5,22 @@ on:
tags:
- '**'

permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

jobs:
prepare:
name: Prepare
runs-on: ubuntu-latest
timeout-minutes: 20
permissions:
contents: write
steps:
- uses: actions/checkout@v3

- name: Set up Node.js LTS
uses: actions/setup-node@v3
- name: Checkout
uses: actions/checkout@v3
- name: Prepare release
uses: stylelint/changelog-to-github-release-action@main
with:
node-version: 'lts/*'
cache: npm

- name: Install latest npm
run: npm install --global npm@latest

- name: Install dependencies
run: npm ci

- name: Extract changelog entries
run: npm run changelog-to-github-release --silent > /tmp/changes.md

- name: Create draft release
run: gh release create "${GITHUB_REF_NAME}" --draft --notes-file /tmp/changes.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
draft: true
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@
"test-only": "npm test --ignore-scripts",
"version": "changeset version",
"postversion": "git restore package.json",
"watch": "npm test --ignore-scripts -- --watch",
"changelog-to-github-release": "remark --quiet --use ./scripts/remark-changelog-to-github-release.mjs CHANGELOG.md"
"watch": "npm test --ignore-scripts -- --watch"
},
"lint-staged": {
"*.{js,mjs}": "eslint --cache --fix",
Expand Down
26 changes: 0 additions & 26 deletions scripts/remark-changelog-to-github-release.mjs

This file was deleted.

0 comments on commit 247c94c

Please sign in to comment.