Skip to content

v4.0.4

v4.0.4 #45

Workflow file for this run

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@v4
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: Run tests
run: npm run test
- 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-style.* | gzip -9 > versatiles-style.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 *.json *.gz --clobber
working-directory: release
- name: Update release
run: gh release edit $RELEASE_TAG --draft=false --latest --prerelease=false