feat(ci): generalize publish-bundle action and script

This commit is contained in:
mkorwel
2025-10-28 12:43:10 -07:00
parent 1666218952
commit 3fa8a7e9fd
9 changed files with 593 additions and 180 deletions
+12 -25
View File
@@ -29,7 +29,7 @@ jobs:
name: 'Publish Bundle'
runs-on: 'ubuntu-latest'
outputs:
version: '${{ steps.version.outputs.version }}'
version: '${{ steps.vars.outputs.version }}'
permissions:
contents: 'read'
packages: 'write'
@@ -46,37 +46,24 @@ jobs:
node-version-file: '.nvmrc'
cache: 'npm'
- name: 'Install dependencies'
run: 'npm ci'
- name: 'Setup NPMRC'
uses: './.github/actions/setup-npmrc'
with:
github-token: '${{ secrets.GITHUB_TOKEN }}'
- name: 'Bundle'
run: 'npm run bundle'
- name: 'Prepare for GitHub release'
run: 'node scripts/prepare-github-release.js'
- name: 'Set CI Version'
id: 'version'
- name: 'Calculate Version and Tag'
id: 'vars'
run: |
CURRENT_VERSION=$(node -p "require('./package.json').version")
NEW_VERSION="${CURRENT_VERSION}-ci.${{ github.run_number }}.${{ github.sha }}"
echo "version=${NEW_VERSION}" >> "$GITHUB_OUTPUT"
npm version --no-git-tag-version "${NEW_VERSION}"
- name: 'Publish to GitHub Packages'
env:
NODE_AUTH_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npm publish --tag="pr-${{ github.event.pull_request.number }}"
echo "tag=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
else
npm publish --tag="ci"
echo "tag=ci" >> "$GITHUB_OUTPUT"
fi
- name: 'Publish Bundle'
uses: './.github/actions/publish-bundle'
with:
version: '${{ steps.vars.outputs.version }}'
tag: '${{ steps.vars.outputs.tag }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
package-scope: '${{ inputs.npm-registry-scope }}'
build-and-publish-sandbox:
name: 'Build and Publish Sandbox'
+1 -4
View File
@@ -100,15 +100,13 @@ jobs:
working-directory: './release'
- name: 'Publish Release'
uses: './.github/actions/publish-release'
uses: './.github/actions/publish-release-bundled'
with:
force-skip-tests: '${{ github.event.inputs.force_skip_tests }}'
release-version: '${{ steps.release_info.outputs.RELEASE_VERSION }}'
release-tag: '${{ github.event.inputs.version }}'
npm-tag: '${{ github.event.inputs.npm_channel }}'
wombat-token-core: '${{ secrets.WOMBAT_TOKEN_CORE }}'
wombat-token-cli: '${{ secrets.WOMBAT_TOKEN_CLI }}'
wombat-token-a2a-server: '${{ secrets.WOMBAT_TOKEN_A2A_SERVER }}'
github-token: '${{ secrets.GITHUB_TOKEN }}'
dry-run: '${{ github.event.inputs.dry_run }}'
previous-tag: '${{ steps.release_info.outputs.PREVIOUS_TAG }}'
@@ -121,7 +119,6 @@ jobs:
cli-package-name: '${{ vars.CLI_PACKAGE_NAME }}'
core-package-name: '${{ vars.CORE_PACKAGE_NAME }}'
a2a-package-name: '${{ vars.A2A_PACKAGE_NAME }}'
use-bundle-release: 'true'
- name: 'Create Issue on Failure'
if: '${{ failure() && github.event.inputs.dry_run == false }}'
+1 -1
View File
@@ -1,4 +1,4 @@
name: 'Release: Manual'
name: 'Release: Manual (Depreciated)'
on:
workflow_dispatch: