Skip to content

make_release

make_release #117

Workflow file for this run

name: make_release
on:
workflow_dispatch:
inputs:
npmVersion:
description: 'NPM Version (<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease | ...)'
required: true
default: 'patch'
comment:
description: 'Added to end of commit message and annotated git tag'
required: true
default: ' ()'
# push:
# branches: [ master ]
# NOTE: workspaces have a bunch of issues with npm version! 'npm version' doesn't add a commit + tag :(
# once there are multiple packages can revisit the step that commits.
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- uses: actions/setup-node@v4
with:
node-version: '24.x'
registry-url: 'https://registry.npmjs.org'
- name: install deps
run: yarn install --frozen-lockfile
- name: build test coverage
run: |
yarn workspace react-babylonjs build
yarn workspace react-babylonjs test:coverage
- name: version-changelog-commit
run: |
npm version ${{ github.event.inputs.npmVersion }} -w packages/react-babylonjs
git status
PACKAGE_VERSION=$(cat packages/react-babylonjs/package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | tr -d '[[:space:]]')
git add packages/react-babylonjs/package.json
git commit -m "release ${PACKAGE_VERSION} :package:${{ github.event.inputs.comment }}"
git status
git tag -a v${PACKAGE_VERSION} -m "version ${PACKAGE_VERSION}"
git push --follow-tags
git status
echo "PACKAGE_VERSION=${PACKAGE_VERSION}" >> $GITHUB_ENV
- name: create github release
env:
GH_TOKEN: ${{ github.token }}
run: gh release create v${PACKAGE_VERSION} --generate-notes --title "v${PACKAGE_VERSION}"
- name: publish npm
working-directory: ./packages/react-babylonjs
run: npm publish --access public --tag r18
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: publish to coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ github.token }}
path-to-lcov: ./packages/react-babylonjs/coverage/lcov.info