Merge pull request #377 from cobusgreyling/fix/loop-cli-publish-0.1.1 #2
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 loop (umbrella CLI) | |
| on: | |
| push: | |
| tags: | |
| - 'loop-v*' | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: 'Tag to publish (e.g. loop-v0.1.0)' | |
| required: true | |
| type: string | |
| permissions: | |
| contents: read | |
| id-token: write | |
| jobs: | |
| test-and-publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/{0}', github.event.inputs.tag) || github.ref }} | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: '22' | |
| registry-url: 'https://registry.npmjs.org' | |
| cache: 'npm' | |
| cache-dependency-path: tools/loop/package-lock.json | |
| - name: Ensure npm supports trusted publishing (OIDC) | |
| run: | | |
| npm install -g npm@latest | |
| npm install -g sigstore | |
| - name: Build sibling tools + umbrella | |
| run: | | |
| (cd tools/readiness-core && npm ci && npm run build) | |
| (cd tools/loop-audit && npm ci && npm run build) | |
| (cd tools/loop-sync && npm ci && npm run build) | |
| (cd tools/loop-init && npm ci && npm run build) | |
| (cd tools/loop-cost && npm ci && npm run build) | |
| cd tools/loop | |
| npm ci | |
| npm run build | |
| npm test | |
| - name: Publish to npm | |
| working-directory: tools/loop | |
| run: npm publish --access public --provenance | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |