diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 869ea7f..eaf0e95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,17 +17,10 @@ jobs: build-and-test: runs-on: ubuntu-latest steps: - - name: Dump GitHub context - env: - GITHUB_CONTEXT: ${{ toJson(github) }} - run: echo "$GITHUB_CONTEXT" - name: Set up Python 3.12 uses: actions/setup-python@v6 with: python-version: "3.12" - - name: Versions - run: | - python3 --version - name: Checkout Current Repo uses: actions/checkout@v6 with: @@ -40,8 +33,6 @@ jobs: sudo apt-get install libudev-dev libusb-1.0 sudo apt-get install -y gettext pip install -r requirements.txt - - name: Library version - run: git describe --dirty --always --tags - name: Install package locally run: pip install -e . - name: Test building single package @@ -55,8 +46,3 @@ jobs: git clone --recurse-submodules https://github.com/adafruit/CircuitPython_Community_Bundle.git cd CircuitPython_Community_Bundle circuitpython-build-bundles --filename_prefix test-bundle --library_location libraries --library_depth 2 - - name: Build Python package - run: | - pip install --upgrade setuptools wheel twine readme_renderer testresources - python setup.py sdist - twine check dist/* diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 308b2ce..afe1183 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,6 +6,10 @@ name: Release Actions on: + pull_request: + branches: [main] + push: + branches: [main] release: types: [published] @@ -38,18 +42,14 @@ jobs: if: github.event_name == 'release' && startsWith(github.repository_owner, 'adafruit') needs: [build] runs-on: ubuntu-latest + permissions: + # needed for authenticating with PyPI trusted publisher + id-token: write steps: - name: Download build artifacts uses: actions/download-artifact@v6 with: name: dist path: ./dist - - name: Set up Python - uses: actions/setup-python@v6 - with: - python-version: '3.12' - name: Publish to PyPI - env: - TWINE_USERNAME: ${{ secrets.pypi_username }} - TWINE_PASSWORD: ${{ secrets.pypi_password }} - run: pipx run twine upload dist/* + uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0