Manual Publish #3
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: Manual Publish | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| package: | |
| description: 'Package to publish' | |
| required: true | |
| type: choice | |
| options: | |
| - typescript | |
| - python | |
| - both | |
| git-ref: | |
| description: 'Git ref (tag, branch, or commit SHA) to publish from' | |
| required: true | |
| default: 'main' | |
| permissions: | |
| contents: read | |
| jobs: | |
| publish-npm: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.inputs.package == 'typescript' || github.event.inputs.package == 'both' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.git-ref }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '18' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build TypeScript package | |
| run: npm run build | |
| - name: Publish to npm | |
| working-directory: packages/flarelette-jwt-ts | |
| run: npm publish --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| publish-pypi: | |
| runs-on: ubuntu-latest | |
| if: ${{ github.event.inputs.package == 'python' || github.event.inputs.package == 'both' }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: ${{ github.event.inputs.git-ref }} | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.11' | |
| - name: Install build tools | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build twine | |
| - name: Build Python package | |
| working-directory: packages/flarelette-jwt-py | |
| run: | | |
| python prepare.py | |
| python -m build | |
| - name: Publish to PyPI | |
| working-directory: packages/flarelette-jwt-py | |
| run: python -m twine upload dist/* | |
| env: | |
| TWINE_USERNAME: __token__ | |
| TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} |