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

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