ci: publish npm packages after releases (#12076)

This commit is contained in:
Lifei Zhou
2026-09-15 21:29:21 +00:00
committed by GitHub
parent 426967db21
commit abb4746599
+16 -4
View File
@@ -1,6 +1,13 @@
name: Goose ACP npm release
on:
workflow_run:
workflows:
- Release
types:
- completed
branches-ignore:
- "release/**"
workflow_dispatch:
inputs:
release_tag:
@@ -19,6 +26,9 @@ permissions:
jobs:
pack:
name: Pack npm packages
if: |
github.event_name == 'workflow_dispatch' ||
github.event.workflow_run.conclusion == 'success'
runs-on: ubuntu-latest
outputs:
version: ${{ steps.prepare.outputs.version }}
@@ -26,13 +36,13 @@ jobs:
- name: Checkout release tag
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.release_tag }}
ref: ${{ github.event.workflow_run.head_branch || inputs.release_tag }}
- name: Prepare npm package tarballs
id: prepare
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ inputs.release_tag }}
RELEASE_TAG: ${{ github.event.workflow_run.head_branch || inputs.release_tag }}
run: |
bash ui/scripts/prepare-npm-packages.sh \
"$RELEASE_TAG" "$RUNNER_TEMP/npm-packages"
@@ -48,7 +58,9 @@ jobs:
publish:
name: Publish npm packages
if: ${{ inputs.publish }}
if: |
needs.pack.result == 'success' &&
(github.event_name == 'workflow_run' || inputs.publish)
needs: pack
runs-on: ubuntu-latest
environment: npm-production-publishing
@@ -59,7 +71,7 @@ jobs:
- name: Checkout release tag
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
ref: ${{ inputs.release_tag }}
ref: ${{ github.event.workflow_run.head_branch || inputs.release_tag }}
- name: Download npm package tarballs
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1