Skip to content

v4.13.0

v4.13.0 #93

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
publish-npm:
name: Publish to NPM
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 12
registry-url: https://registry.npmjs.org/
- if: ${{ !github.event.release.prerelease }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- if: ${{ github.event.release.prerelease }}
run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
publish-assets:
name: Publish to assets server
if: ${{ !github.event.release.prerelease }}
needs: [build, publish-npm]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: css
path: css
- name: Install upload-assets snap
run: sudo snap install upload-assets
- name: Upload to assets server
run: upload-assets --url-path vanilla-framework-version-$(cat css/VANILLA_VERSION).min.css css/build.css
env:
UPLOAD_ASSETS_API_TOKEN: ${{secrets.UPLOAD_ASSETS_API_TOKEN}}
notify-figma:
name: Notify Figma library maintainers
needs: publish-npm
runs-on: ubuntu-latest
steps:
- name: Extract release notes sections
id: extract_release_notes
run: |
RELEASE_NOTES=$(echo "${{ github.event.release.body }}" | jq -R . | jq -r .)
FEATURES=$(echo "$RELEASE_NOTES" | sed -n '/## 🚀 Features/,/## /p' | sed '$d')
BUG_FIXES=$(echo "$RELEASE_NOTES" | sed -n '/## 🐛 Bug Fixes/,/## /p' | sed '$d')
MAINTENANCE=$(echo "$RELEASE_NOTES" | 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: |
curl -X POST -H "Content-Type: application/json" -d '{"source": "Vanilla CSS", "change-summary": "${{ steps.extract_release_notes.outputs.change_summary }}"}' ${{ secrets.FIGMA_LIBRARY_ALERT_URL }}