Debian Codegraph @

.github/workflows/ci.yml

raw
1 on:
2 push:
3 tags:
4 - "v*" # Push events to matching `v*` version srings. e.g. v1.0, v20.15.10
5
6 name: Create and Publish Release
7
8 jobs:
9 build:
10 name: Build distribution
11 runs-on: ubuntu-latest
12 steps:
13 - uses: actions/checkout@v4
14 with:
15 submodules: recursive
16 fetch-depth: 0
17 - name: Set up Python
18 uses: actions/setup-python@v5
19 with:
20 python-version: '3.x'
21
22 - name: Install release dependencies
23 run: |
24 python -m pip install --upgrade pip
25 pip install --upgrade setuptools wheel build
26
27 - name: Get release notes
28 id: release_notes
29 run: |
30 # By default, GH Actions checkout will only fetch a single commit.
31 # For us to extract the release notes, we need to fetch the tags
32 # and tag annotations as well.
33 # https://github.com/actions/checkout/issues/290
34 git fetch --tags --force
35 TAG_NAME=${GITHUB_REF/refs\/tags\//}
36 echo "$(git tag -l --format='%(contents)' $TAG_NAME)" > "${{ runner.temp }}/CHANGELOG.md"
37
38 - name: Create GitHub release
39 id: create_release
40 uses: actions/create-release@v1
41 env:
42 GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43 with:
44 tag_name: ${{ github.ref }}
45 release_name: ${{ github.ref }}
46 body_path: "${{ runner.temp }}/CHANGELOG.md"
47 draft: false
48 prerelease: false
49
50 - name: Build a binary wheel and a source tarball
51 run: python3 -m build
52 - name: Store the distribution packages
53 uses: actions/upload-artifact@v4
54 with:
55 name: python-package-distributions
56 path: dist/
57
58 publish-to-pypi:
59 name: >-
60 Publish Python 🐍 distribution 📦 to PyPI
61 if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
62 needs:
63 - build
64 runs-on: ubuntu-latest
65 environment:
66 name: pypi
67 url: https://pypi.org/p/babelfont
68 permissions:
69 id-token: write # IMPORTANT: mandatory for trusted publishing
70 steps:
71 - name: Download all the dists
72 uses: actions/download-artifact@v4
73 with:
74 name: python-package-distributions
75 path: dist/
76 - name: Publish distribution 📦 to PyPI
77 uses: pypa/[email protected]
78 with:
79 # repository-url: https://test.pypi.org/legacy/ # for testing purposes
80 verify-metadata: false # twine previously didn't verify metadata when uploading