]> git.madduck.net Git - etc/vim.git/blob - .github/workflows/pypi_upload.yml

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Adding pyproject.toml configuration output to verbose logging (#3392)
[etc/vim.git] / .github / workflows / pypi_upload.yml
1 name: Publish to PyPI
2
3 on:
4   release:
5     types: [published]
6
7 permissions:
8   contents: read
9
10 jobs:
11   main:
12     name: sdist + pure wheel
13     runs-on: ubuntu-latest
14
15     steps:
16       - uses: actions/checkout@v3
17
18       - name: Set up latest Python
19         uses: actions/setup-python@v4
20         with:
21           python-version: "*"
22
23       - name: Install latest pip, build, twine
24         run: |
25           python -m pip install --upgrade --disable-pip-version-check pip
26           python -m pip install --upgrade build twine
27
28       - name: Build wheel and source distributions
29         run: python -m build
30
31       - name: Upload to PyPI via Twine
32         env:
33           TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
34         run: twine upload --verbose -u '__token__' dist/*
35
36   mypyc:
37     name: mypyc wheels (${{ matrix.name }})
38     runs-on: ${{ matrix.os }}
39     strategy:
40       fail-fast: false
41       matrix:
42         include:
43           - os: ubuntu-latest
44             name: linux-x86_64
45           - os: windows-2019
46             name: windows-amd64
47           - os: macos-11
48             name: macos-x86_64
49             macos_arch: "x86_64"
50           # Only build x86_64 wheels on macos until #3312 is fixed
51           # - os: macos-11
52           #   name: macos-arm64
53           #   macos_arch: "arm64"
54           # - os: macos-11
55           #   name: macos-universal2
56           #   macos_arch: "universal2"
57
58     steps:
59       - uses: actions/checkout@v3
60
61       - name: Build wheels via cibuildwheel
62         uses: pypa/cibuildwheel@v2.11.2
63         env:
64           CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
65
66       - name: Upload wheels as workflow artifacts
67         uses: actions/upload-artifact@v3
68         with:
69           name: ${{ matrix.name }}-mypyc-wheels
70           path: ./wheelhouse/*.whl
71
72       - name: Upload wheels to PyPI via Twine
73         env:
74           TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
75         run: pipx run twine upload --verbose -u '__token__' wheelhouse/*.whl
76
77   update-stable-branch:
78     name: Update stable branch
79     needs: [main, mypyc]
80     runs-on: ubuntu-latest
81     permissions:
82       contents: write
83
84     steps:
85       - name: Checkout stable branch
86         uses: actions/checkout@v3
87         with:
88           ref: stable
89           fetch-depth: 0
90
91       - name: Update stable branch to release tag & push
92         run: |
93           git reset --hard ${{ github.event.release.tag_name }}
94           git push