v3.4.1 #30
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
workflow_dispatch: | |
jobs: | |
release: | |
name: Build and release | |
runs-on: ubuntu-latest | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 20 | |
- name: Cache node modules | |
id: cache-node-modules | |
uses: actions/cache@v3 | |
with: | |
path: node_modules | |
key: node-modules-${{ runner.os }}-${{ hashFiles('package-lock.json') }} | |
- name: Install dependencies | |
if: steps.cache-node-modules.outputs.cache-hit != 'true' | |
run: npm ci | |
- name: Build styles | |
run: npm run build-styles | |
- name: Compress styles | |
run: tar -cf - *.json | gzip -9 > styles.tar.gz | |
working-directory: release | |
- name: Build browser | |
run: npm run build-browser | |
- name: Compress script | |
run: tar -cf - versatiles-styles.* | gzip -9 > versatiles-styles.tar.gz | |
working-directory: release | |
- name: Get version | |
run: 'echo "RELEASE_TAG=v$(jq -r ''.version'' package.json)" >> $GITHUB_ENV' | |
- name: Upload file to release | |
run: gh release upload $RELEASE_TAG *.js *.gz --clobber | |
working-directory: release | |
- name: Update release | |
run: gh release edit $RELEASE_TAG --draft=false --latest --prerelease=false |