willbakst is releasing py/v0.0.3 #10
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 | |
| run-name: ${{ github.actor }} is releasing ${{ github.ref_name }} | |
| on: | |
| release: | |
| types: [published] | |
| permissions: | |
| contents: read | |
| jobs: | |
| detect-language: | |
| runs-on: ubuntu-latest | |
| outputs: | |
| language: ${{ steps.set-language.outputs.language }} | |
| steps: | |
| - name: Determine language from tag | |
| id: set-language | |
| run: | | |
| TAG_NAME="${{ github.ref_name }}" | |
| if [[ $TAG_NAME == py/* ]]; then | |
| echo "language=python" >> $GITHUB_OUTPUT | |
| elif [[ $TAG_NAME == js/* ]]; then | |
| echo "language=javascript" >> $GITHUB_OUTPUT | |
| else | |
| echo "Unknown language prefix in tag: $TAG_NAME" | |
| exit 1 | |
| fi | |
| release-python: | |
| needs: detect-language | |
| if: needs.detect-language.outputs.language == 'python' | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up uv | |
| run: curl -LsSf https://astral.sh/uv/0.6.4/install.sh | sh | |
| - name: Set up Python | |
| run: uv python install 3.10 | |
| - name: Change to Python directory | |
| run: cd python | |
| - name: Build Package | |
| working-directory: ./python | |
| run: uv build | |
| - name: Publish Python Package | |
| working-directory: ./python | |
| run: uv publish | |
| release-javascript: | |
| needs: detect-language | |
| if: needs.detect-language.outputs.language == 'javascript' | |
| runs-on: ubuntu-latest | |
| environment: release | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: "18" | |
| registry-url: "https://registry.npmjs.org" | |
| - name: Setup pnpm | |
| uses: pnpm/action-setup@v2 | |
| with: | |
| version: 8 | |
| - name: Install dependencies | |
| working-directory: typescript | |
| run: pnpm install | |
| - name: Build package | |
| working-directory: typescript | |
| run: pnpm run build | |
| - name: Publish to NPM | |
| working-directory: typescript | |
| run: pnpm publish --no-git-checks | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |