github.com/yoheimuta/protolint@v0.49.8-0.20240515023657-4ecaebb7575d/.github/workflows/publish_wheel.yml (about) 1 --- 2 name: Publish Wheel Package 3 on: 4 workflow_dispatch: 5 workflow_run: 6 workflows: [goreleaser] 7 types: 8 - completed 9 10 jobs: 11 publish_whl: 12 name: Publish Wheel 13 runs-on: ubuntu-latest 14 steps: 15 - name: Checkout sources 16 uses: actions/checkout@v4 17 with: 18 fetch-tags: true 19 - name: Run go release to create binaries 20 uses: actions/setup-go@v3 21 with: 22 go-version: 1.21 23 - name: Run GoReleaser 24 uses: goreleaser/goreleaser-action@v2 25 with: 26 distribution: goreleaser 27 version: latest 28 args: build --clean 29 - name: Install Python 30 uses: actions/setup-python@v4 31 with: 32 python-version: '3.12' 33 - name: Install Twine 34 run: python -m pip install twine 35 - name: Pack WHEEL Package 36 working-directory: ./bdist/py 37 run: python3 setup.py 38 - name: Check WHEEL Packages 39 working-directory: ./bdist/py 40 run: twine check _wheel/* 41 - name: Issue warning if TWINE_USERNAME and TWINE_PASSWORD are not set 42 env: 43 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 44 TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} 45 run: | 46 echo -n "::warning title=Missing authentication token::In order to publish an wheel package, you must set " 47 echo "the PYPI_USERNAME and PYPI_AUTH_TOKEN secrets" 48 if: ${{ (env.TWINE_USERNAME == '') || (env.TWINE_PASSWORD == '') }} 49 - name: Publish WHEEL package 50 env: 51 TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} 52 TWINE_PASSWORD: ${{ secrets.PYPI_AUTH_TOKEN }} 53 run: twine upload _wheel/* 54 working-directory: ./bdist/py 55 if: ${{ (env.TWINE_USERNAME != '') && (env.TWINE_PASSWORD != '') }}