]> 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 peter-evans/find-comment from 2.3.0 to 2.4.0 (#3670)
[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.12.3
62         env:
63           CIBW_ARCHS_MACOS: "${{ matrix.macos_arch }}"
64
65       - name: Upload wheels as workflow artifacts
66         uses: actions/upload-artifact@v3
67         with:
68           name: ${{ matrix.name }}-mypyc-wheels
69           path: ./wheelhouse/*.whl
70
71       - name: Upload wheels to PyPI via Twine
72         env:
73           TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
74         run: pipx run twine upload --verbose -u '__token__' wheelhouse/*.whl
75
76   update-stable-branch:
77     name: Update stable branch
78     needs: [main, mypyc]
79     runs-on: ubuntu-latest
80     permissions:
81       contents: write
82
83     steps:
84       - name: Checkout stable branch
85         uses: actions/checkout@v3
86         with:
87           ref: stable
88           fetch-depth: 0
89
90       - name: Update stable branch to release tag & push
91         run: |
92           git reset --hard ${{ github.event.release.tag_name }}
93           git push