]> git.madduck.net Git - etc/vim.git/blob - .github/workflows/upload_binary.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:

Build macOS releases (#2198)
[etc/vim.git] / .github / workflows / upload_binary.yml
1 name: Upload self-contained binaries
2
3 on:
4   release:
5     types: [published]
6
7 jobs:
8   build:
9     runs-on: ${{ matrix.os }}
10     strategy:
11       fail-fast: false
12       matrix:
13         python-version: [3.7]
14         os: [windows-2019, ubuntu-20.04, macos-latest]
15         include:
16           - os: windows-2019
17             pathsep: ";"
18             asset_name: black_windows.exe
19             executable_mime: "application/vnd.microsoft.portable-executable"
20           - os: ubuntu-20.04
21             pathsep: ":"
22             asset_name: black_linux
23             executable_mime: "application/x-executable"
24           - os: macos-latest
25             pathsep: ":"
26             asset_name: black_macos
27             executable_mime: "application/x-mach-binary"
28
29     steps:
30       - uses: actions/checkout@v2
31
32       - name: Set up Python ${{ matrix.python-version }}
33         uses: actions/setup-python@v2
34         with:
35           python-version: ${{ matrix.python-version }}
36
37       - name: Install dependencies
38         run: |
39           python -m pip install --upgrade pip wheel setuptools
40           python -m pip install .
41           python -m pip install pyinstaller
42
43       - name: Build binary
44         run: |
45           python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
46
47       - name: Upload binary as release asset
48         uses: actions/upload-release-asset@v1
49         env:
50           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51         with:
52           upload_url: ${{ github.event.release.upload_url }}
53           asset_path: dist/${{ matrix.asset_name }}
54           asset_name: ${{ matrix.asset_name }}
55           asset_content_type: ${{ matrix.executable_mime }}