From 2a86f3da0767e2109bcd78b5a9a5b72d1f2aa6c8 Mon Sep 17 00:00:00 2001 From: pukkandan Date: Fri, 19 Feb 2021 16:16:08 +0530 Subject: [PATCH] [build] Publish on PyPi only if token is set This allows forks to easily build releases :ci skip all --- .github/workflows/build.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f53e61d4a5..58a72c9e51 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,6 +57,9 @@ jobs: id: sha2_file run: echo "::set-output name=sha2_unix::$(sha256sum youtube-dlc | awk '{print $1}')" - name: Install dependencies for pypi + env: + PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} + if: "env.PYPI_TOKEN != ''" run: | python -m pip install --upgrade pip pip install setuptools wheel twine @@ -64,6 +67,7 @@ jobs: env: TWINE_USERNAME: __token__ TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} + if: "env.TWINE_PASSWORD != ''" run: | rm -rf dist/* python setup.py sdist bdist_wheel @@ -171,16 +175,3 @@ jobs: asset_path: ./SHA2-256SUMS asset_name: SHA2-256SUMS asset_content_type: text/plain - -# update_version_badge: -# runs-on: ubuntu-latest -# needs: build_unix -# steps: -# - name: Create Version Badge -# uses: schneegans/dynamic-badges-action@v1.0.0 -# with: -# auth: ${{ secrets.GIST_TOKEN }} -# gistID: c69cb23c3c5b3316248e52022790aa57 -# filename: version.json -# label: Version -# message: ${{ needs.build_unix.outputs.ytdlc_version }}