]> 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:

Bump furo from 2022.6.21 to 2022.9.15 in /docs (#3277)
[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           - os: macos-11
51             name: macos-arm64
52             macos_arch: "arm64"
53           - os: macos-11
54             name: macos-universal2
55             macos_arch: "universal2"
56
57     steps:
58       - uses: actions/checkout@v3
59
60       - name: Build wheels via cibuildwheel
61         uses: pypa/cibuildwheel@v2.8.1
62         env:
63           CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
64           # This isn't supported in pyproject.toml which makes sense (but is annoying).
65           CIBW_PROJECT_REQUIRES_PYTHON: ">=3.6.2"
66
67       - name: Upload wheels as workflow artifacts
68         uses: actions/upload-artifact@v2
69         with:
70           name: ${{ matrix.name }}-mypyc-wheels
71           path: ./wheelhouse/*.whl
72
73       - name: Upload wheels to PyPI via Twine
74         env:
75           TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
76         run: pipx run twine upload --verbose -u '__token__' wheelhouse/*.whl
77
78   update-stable-branch:
79     name: Update stable branch
80     needs: [main, mypyc]
81     runs-on: ubuntu-latest
82     permissions:
83       contents: write
84
85     steps:
86       - name: Checkout stable branch
87         uses: actions/checkout@v3
88         with:
89           ref: stable
90           fetch-depth: 0
91
92       - name: Update stable branch to release tag & push
93         run: |
94           git reset --hard ${{ github.event.release.tag_name }}
95           git push