Release #437
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 | |
| on: | |
| push: | |
| tags: | |
| - "camera-ui-*-v*" | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: release-${{ github.ref }} | |
| cancel-in-progress: false | |
| jobs: | |
| resolve: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| plugin: ${{ steps.resolve.outputs.plugin }} | |
| version: ${{ steps.resolve.outputs.version }} | |
| runtime: ${{ steps.resolve.outputs.runtime }} | |
| externals: ${{ steps.resolve.outputs.externals }} | |
| dist_tag: ${{ steps.resolve.outputs.dist_tag }} | |
| python_version: ${{ steps.resolve.outputs.python_version }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - id: resolve | |
| run: node .github/scripts/resolve-release.mjs | |
| publish: | |
| needs: resolve | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| contents: read | |
| id-token: write # OIDC: npm provenance + trusted publishing (no NPM_TOKEN) | |
| env: | |
| PLUGIN: ${{ needs.resolve.outputs.plugin }} | |
| VERSION: ${{ needs.resolve.outputs.version }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Sync sources from base plugin | |
| run: | | |
| if [ -f "$PLUGIN/scripts/sync.mjs" ]; then | |
| node "$PLUGIN/scripts/sync.mjs" | |
| fi | |
| - name: Init submodule | |
| if: needs.resolve.outputs.externals != '' | |
| run: git submodule update --init --depth 1 ${{ needs.resolve.outputs.externals }} | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: "22" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup Python | |
| if: needs.resolve.outputs.runtime == 'python' | |
| uses: actions/setup-python@v7 | |
| with: | |
| python-version: ${{ needs.resolve.outputs.python_version }} | |
| - name: Install Python deps (mypy for build + plugin requirements) | |
| if: needs.resolve.outputs.runtime == 'python' | |
| run: pip install mypy -r "$PLUGIN/requirements.txt" | |
| - name: Setup Go | |
| if: needs.resolve.outputs.runtime == 'go' | |
| uses: actions/setup-go@v7 | |
| with: | |
| go-version-file: ${{ needs.resolve.outputs.plugin }}/go.mod | |
| cache-dependency-path: ${{ needs.resolve.outputs.plugin }}/go.sum | |
| - name: Verify tag matches plugin package.json version | |
| run: | | |
| PKG="$(node -p "require('./$PLUGIN/package.json').version")" | |
| echo "tag=$VERSION package.json=$PKG" | |
| if [ "$VERSION" != "$PKG" ]; then | |
| echo "::error::tag version $VERSION does not match $PLUGIN/package.json version $PKG" | |
| exit 1 | |
| fi | |
| - name: Install plugin dependencies | |
| run: npm --prefix "$PLUGIN" install --ignore-scripts --force | |
| - name: Build | |
| run: npm --prefix "$PLUGIN" run build | |
| - name: Bundle | |
| working-directory: ${{ needs.resolve.outputs.plugin }} | |
| run: npx cui bundle | |
| - name: Publish to npm (provenance via OIDC) | |
| working-directory: ${{ needs.resolve.outputs.plugin }} | |
| run: | | |
| npm install -g npm@11.18.0 | |
| npx cui publish --${{ needs.resolve.outputs.dist_tag }} --yes --provenance |