tlds build #578
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: tlds build | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
schedule: | |
- cron: "21 4 * * *" | |
jobs: | |
update: | |
name: Update from IANA | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Update top-level domains from iana | |
run: ./update.sh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
publish: | |
name: Publish to PyPI | |
runs-on: ubuntu-latest | |
needs: update | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install dependencies | |
run: | | |
sudo apt install -y jq curl | |
pip install wheel | |
- name: Check versions | |
id: get | |
run: | | |
set -ex | |
echo "pkgver=`curl -s https://pypi.org/pypi/tlds/json | jq -r .info.version || echo none`" >> $GITHUB_OUTPUT | |
echo "newver=`cat version`" >> $GITHUB_OUTPUT | |
- name: Build a binary wheel and a source tarball | |
run: | | |
python setup.py sdist bdist_wheel | |
- name: Publish to PyPI | |
if: steps.get.outputs.pkgver != steps.get.outputs.newver && github.ref == 'refs/heads/master' | |
uses: pypa/gh-action-pypi-publish@release/v1 |