update testpypi dist #18
This file contains 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: Python CD | |
on: | |
push: | |
branches: | |
- gabriel/poetry | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
#if: github.event_name == 'release' | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
#- name: Verify the tag version in the pyproject.toml | |
# run: grep -q "version = \"${{ github.event.release.tag_name }}\"" pyproject.toml || exit 1 | |
# shell: bash | |
- name: Set Node.js 20.x | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'yarn' | |
- uses: ./.github/actions/python_prepare | |
- name: Build Frontend | |
env: | |
CI: false # needed otherwise dependencies warnings stop the job | |
run: yarn --cwd python_web3_wallet/frontend build | |
- name: Build a binary wheel and a source tarball | |
run: poetry build | |
- name: Store the distribution packages | |
uses: actions/upload-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
# - name: Build and Publish | |
# run: poetry publish -p ${{ secrets.PYPI_TOKEN }} -u "__token__" --repository testpypi # ToDo change to Pypi | |
# shell: bash | |
publish-to-testpypi: | |
name: Publish to TestPyPI | |
needs: | |
- build | |
runs-on: ubuntu-latest | |
environment: | |
name: testpypi | |
url: https://test.pypi.org/p/python-web3-wallet | |
permissions: | |
id-token: write # IMPORTANT: mandatory for trusted publishing | |
steps: | |
- name: Download all the dists | |
uses: actions/download-artifact@v4 | |
with: | |
name: python-package-distributions | |
path: dist/ | |
- name: Publish distribution to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
username: __token__ | |
password: ${{ secrets.PYPI_TOKEN }} | |
repository-url: https://test.pypi.org/simple/ |