name: Release on: push: tags: - "*" permissions: {} env: GH_TELEMETRY: "false" jobs: build: name: Build artifacts permissions: contents: read runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: fetch-depth: 0 # Needed for hatch-vcs versioning persist-credentials: false - uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 with: deno-version: 3fbb1daddbc9333cddf0d8c0735811717dd70f7a # v2.6.3 cache: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0 with: python-version: "3.14" - name: Install Python requirements run: | python -m pip install -U build - name: Build Python artifacts run: | python -m build - name: Upload Python artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: artifacts-py path: | dist/yt_dlp_ejs-*.whl dist/yt_dlp_ejs-*.tar.gz compression-level: 0 - name: Build JavaScript artifacts run: | deno install --frozen deno task bundle - name: Upload JavaScript artifacts uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 with: name: artifacts-js path: | dist/yt.solver.*.js compression-level: 0 publish_pypi: name: Publish to PyPI needs: [build] if: github.repository == 'yt-dlp/ejs' permissions: id-token: write # Needed for PyPI trusted publishing runs-on: ubuntu-latest steps: - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: dist name: artifacts-py - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@cef221092ed1bacb1cc03d23a2d87d1d172e277b # v1.14.0 with: verbose: true release: name: Create GitHub release needs: [build, publish_pypi] if: always() && !failure() && !cancelled() permissions: contents: write # Needed by gh to publish release to Github runs-on: ubuntu-latest steps: - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 with: persist-credentials: false - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 with: path: dist pattern: artifacts-* merge-multiple: true - name: Create GitHub Release env: TAG: ${{ github.ref_name }} GH_TOKEN: ${{ github.token }} run: | gh release create "${TAG}" \ --title "yt-dlp-ejs ${TAG}" \ --generate-notes \ --verify-tag \ dist/yt.solver.*.js \ dist/yt_dlp_ejs-*.whl \ dist/yt_dlp_ejs-*.tar.gz