test releae with broken release body #10
Workflow file for this run
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: Publish Vanilla release | |
on: | |
release: | |
types: [published] | |
jobs: | |
build: | |
name: Build Vanilla | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Read Vanilla version from package.json | |
run: | | |
node -p "require('./package.json').version" > VANILLA_VERSION | |
echo "Building Vanilla v$(cat VANILLA_VERSION)" | |
- run: yarn install | |
- run: yarn build | |
- run: yarn test | |
- name: Show size of the build file | |
run: stat -c '%s' build/css/build.css | |
- run: cp VANILLA_VERSION build/css | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: css | |
path: build/css | |
notify-figma: | |
name: Notify Figma library maintainers | |
runs-on: ubuntu-latest | |
steps: | |
- name: Extract release notes sections | |
id: extract_release_notes | |
run: | | |
RELEASE_NOTES_SANITIZED=$(echo "${{ github.event.release.body }}" | jq -R . | jq -r .) | |
echo "SANITIZED: $RELEASE_NOTES_SANITIZED" | |
FEATURES=$(echo "$RELEASE_NOTES_SANITIZED" | sed -n '/## 🚀 Features/,/## /p' | sed '$d') | |
BUG_FIXES=$(echo "$RELEASE_NOTES_SANITIZED" | sed -n '/## 🐛 Bug Fixes/,/## /p' | sed '$d') | |
MAINTENANCE=$(echo "$RELEASE_NOTES_SANITIZED" | sed -n '/## 🔨 Maintenance/,/## /p' | sed '$d') | |
CHANGE_SUMMARY="\n$FEATURES\n\n$BUG_FIXES\n\n$MAINTENANCE\n" | |
echo "change_summary=$CHANGE_SUMMARY" >> $GITHUB_OUTPUT | |
- name: Notify Figma library maintainers | |
run: | | |
raw_payload='{"source": "Vanilla CSS", "change-summary": "${{ steps.extract_release_notes.outputs.change_summary }}"}' | |
echo "$raw_payload" | |
payload=$(jq -n --arg source "Vanilla CSS" --arg change_summary "${{ steps.extract_release_notes.outputs.change_summary }}" '{source: $source, "change-summary": $change_summary}') | |
echo "$payload" | |
curl -X POST -H "Content-Type: application/json" -d "$payload" ${{ secrets.FIGMA_LIBRARY_ALERT_URL }} |