Merge pull request #3168 from MatiasManevi:npm-workflow-dispatch
PiperOrigin-RevId: 882559989 Change-Id: Ia02f38e632dcd3064433b44f6e14427aa3b36735
This commit is contained in:
@@ -222,7 +222,7 @@ package_wasm() {
|
|||||||
cp wasm/package.npm.json wasm/dist/package.json
|
cp wasm/package.npm.json wasm/dist/package.json
|
||||||
cp wasm/README.md wasm/dist/README.md
|
cp wasm/README.md wasm/dist/README.md
|
||||||
|
|
||||||
VERSION=${GITHUB_REF#refs/tags/}
|
VERSION="${VERSION:-${GITHUB_REF#refs/tags/}}"
|
||||||
npm --prefix wasm/dist version "${VERSION}" --no-git-tag-version
|
npm --prefix wasm/dist version "${VERSION}" --no-git-tag-version
|
||||||
|
|
||||||
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
|
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > ~/.npmrc
|
||||||
|
|||||||
@@ -5,6 +5,13 @@ on:
|
|||||||
tags:
|
tags:
|
||||||
- '[0-9]*.[0-9]*.[0-9]*'
|
- '[0-9]*.[0-9]*.[0-9]*'
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
tag_version:
|
||||||
|
description: 'Release tag version to deploy'
|
||||||
|
required: true
|
||||||
|
default: '0.0.0'
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
@@ -13,6 +20,10 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
name: Publish MuJoCo WASM package
|
name: Publish MuJoCo WASM package
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
|
|
||||||
|
env:
|
||||||
|
VERSION: ${{ github.event_name == 'workflow_dispatch' && inputs.tag_version || github.ref_name }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
@@ -36,5 +47,5 @@ jobs:
|
|||||||
- name: Package WASM bindings
|
- name: Package WASM bindings
|
||||||
env:
|
env:
|
||||||
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_ACCESS_TOKEN }}
|
||||||
GITHUB_REF: ${{ github.ref }}
|
VERSION: ${{ env.VERSION }}
|
||||||
run: bash ./.github/workflows/build_steps.sh package_wasm
|
run: bash ./.github/workflows/build_steps.sh package_wasm
|
||||||
|
|||||||
Reference in New Issue
Block a user