-
Notifications
You must be signed in to change notification settings - Fork 108
67 lines (65 loc) · 2.63 KB
/
Copy pathrelease.yml
File metadata and controls
67 lines (65 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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: ' ()'
distTag:
description: 'npm dist-tag to publish under (latest for current major, r18 for the React 18 line, etc.)'
required: true
default: 'latest'
# 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
permissions:
contents: write
id-token: write
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 ${{ github.event.inputs.distTag }}
- name: publish to coveralls.io
uses: coverallsapp/github-action@v2
with:
github-token: ${{ github.token }}
path-to-lcov: ./packages/react-babylonjs/coverage/lcov.info