Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,21 @@ jobs:
yarn install --frozen-lockfile --ignore-scripts --prefer-offline
npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Extract the release body from CHANGELOG.md
id: changelog
shell: bash
run: |
node ./scripts/extract_last_release_body.js
RELEASE=$(cat ./RELEASE.md)
echo "RELEASE_BODY=$RELEASE" >> $GITHUB_OUTPUT
- name: Upload release asset
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./index.js
asset_name: postcss-rtlcss.js
tag: ${{ github.ref }}
body: |
${{ steps.changelog.outputs.RELEASE_BODY }}
overwrite: true
9 changes: 9 additions & 0 deletions scripts/extract_last_release_body.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
const fs = require('fs/promises');

const createRelease = async() => {
const data = await fs.readFile('./CHANGELOG.md', { encoding: 'utf8' });
const RELEASE = data.replace(/^#[^#]*?##\s.*?(\d{4}-\d{2}-\d{2}[^#]*)\n[\s\S]*$/, '$1');
await fs.writeFile('./RELEASE.md', RELEASE);
};

createRelease();