Release Editor Kit #43
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Editor Kit | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version to use for editor-preload-ecosystem package' | |
| required: true | |
| use_npm: | |
| description: 'Use npm packages instead of building from source' | |
| type: boolean | |
| default: true | |
| build_official: | |
| description: 'Also build and publish official preload package' | |
| type: boolean | |
| default: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - name: Checkout repo | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Install pnpm | |
| uses: pnpm/action-setup@v4 | |
| with: | |
| run_install: true | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '>=22.6.0' | |
| registry-url: https://registry.npmjs.org/ | |
| cache: pnpm | |
| - name: Make scripts executable | |
| run: | | |
| chmod +x ./scripts/build-editor-preload.js | |
| chmod +x ./scripts/build-official-preload.js | |
| - name: Build editor-preload packages | |
| run: | | |
| USE_NPM_ARG="" | |
| if [ "${{ github.event.inputs.use_npm }}" == "true" ]; then | |
| USE_NPM_ARG="--use-npm" | |
| fi | |
| BUILD_OFFICIAL_ARG="" | |
| if [ "${{ github.event.inputs.build_official }}" == "true" ]; then | |
| BUILD_OFFICIAL_ARG="--build-official" | |
| fi | |
| ./scripts/build-editor-preload.js --version=${{ github.event.inputs.version }} $USE_NPM_ARG $BUILD_OFFICIAL_ARG | |
| - name: Release packages and Sync to CDN | |
| uses: galacean/publish@main | |
| with: | |
| publish: false | |
| packages: | | |
| editor-preload-ecosystem | |
| ${{ github.event.inputs.build_official == 'true' && 'editor-preload-official' || '' }} | |
| env: | |
| NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | |
| NPM_CONFIG_PROVENANCE: true | |
| OASISBE_UPLOAD_URL: https://oasisbe.alipay.com/api/file/no-auth/crypto/upload | |
| OASISBE_REQUEST_HEADER: ${{secrets.OASISBE_REQUEST_HEADER}} | |
| OASISBE_PUBLIC_KEY: ${{secrets.OASISBE_PUBLIC_KEY}} | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: editor-preload-packages | |
| path: | | |
| editor-preload-ecosystem/dist/browser.js | |
| ${{ github.event.inputs.build_official == 'true' && 'editor-preload-official/dist/browser.js' || '' }} | |
| retention-days: 7 |