roqueform-5.1.0 #22
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 | |
on: | |
push: | |
tags: [ "*-v[0-9]+.[0-9]+.[0-9]+" ] | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
cache: npm | |
registry-url: "https://registry.npmjs.org" | |
- name: Configure git user | |
run: | | |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config user.name "github-actions[bot]" | |
- name: Resolve workspace | |
run: echo "WORKSPACE=packages/$(echo ${{ github.ref_name }} | rev | cut -d- -f2- | rev)" >> ${GITHUB_ENV} | |
- run: npm ci | |
- name: Build packages | |
run: | | |
[ $WORKSPACE == packages/roqueform ] || npm run build --workspace=packages/roqueform | |
npm run build --workspace=${WORKSPACE} | |
- run: npm test --workspace=${WORKSPACE} | |
- run: npm run test:definitions --if-present --workspace=${WORKSPACE} | |
- run: npm run docs | |
- run: npm publish --workspace=${WORKSPACE} --access public | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish docs | |
run: | | |
set -x | |
mv ./docs /tmp/docs | |
git fetch origin ghpages:ghpages | |
git checkout ghpages | |
git rm -rf . | |
git clean -fxd | |
cp -R /tmp/docs/. . | |
git add . | |
! git diff --staged --quiet --exit-code || exit 0 | |
git commit -m "Updated docs (${GITHUB_SHA::7})" | |
git push origin ghpages | |
- name: Create release draft | |
run: gh release create ${{ github.ref_name }} --generate-notes --draft | |
env: | |
GH_TOKEN: ${{ github.token }} |