python2ts: v1.1.0 #8
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: Publish | |
| on: | |
| release: | |
| types: [published] | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: "Package to publish" | |
| required: true | |
| type: choice | |
| options: | |
| - pythonlib | |
| - python2ts | |
| dry-run: | |
| description: "Dry run (skip actual publish)" | |
| required: false | |
| default: true | |
| type: boolean | |
| permissions: | |
| contents: read | |
| id-token: write # Required for OIDC | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: pnpm/action-setup@v4 | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: "24" # npm v11+ required for OIDC | |
| cache: "pnpm" | |
| registry-url: "https://registry.npmjs.org" | |
| - run: pnpm install --frozen-lockfile | |
| - run: pnpm build | |
| - name: Determine package from release tag | |
| if: github.event_name == 'release' | |
| id: package | |
| run: | | |
| TAG="${{ github.event.release.tag_name }}" | |
| if [[ "$TAG" == pythonlib-* ]]; then | |
| echo "name=pythonlib" >> $GITHUB_OUTPUT | |
| elif [[ "$TAG" == python2ts-* ]]; then | |
| echo "name=python2ts" >> $GITHUB_OUTPUT | |
| else | |
| echo "Unknown tag format: $TAG" | |
| exit 1 | |
| fi | |
| - name: Publish pythonlib | |
| if: | | |
| (github.event_name == 'release' && steps.package.outputs.name == 'pythonlib') || | |
| (github.event_name == 'workflow_dispatch' && inputs.package == 'pythonlib' && !inputs.dry-run) | |
| run: pnpm --filter pythonlib publish --access public --no-git-checks --provenance | |
| - name: Publish python2ts | |
| if: | | |
| (github.event_name == 'release' && steps.package.outputs.name == 'python2ts') || | |
| (github.event_name == 'workflow_dispatch' && inputs.package == 'python2ts' && !inputs.dry-run) | |
| run: pnpm --filter python2ts publish --access public --no-git-checks --provenance | |
| - name: Dry run pythonlib | |
| if: | |
| github.event_name == 'workflow_dispatch' && inputs.package == 'pythonlib' && | |
| inputs.dry-run | |
| run: pnpm --filter pythonlib publish --dry-run | |
| - name: Dry run python2ts | |
| if: | |
| github.event_name == 'workflow_dispatch' && inputs.package == 'python2ts' && | |
| inputs.dry-run | |
| run: pnpm --filter python2ts publish --dry-run |