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

ed8d9fdd572a8ba8afa2766fcdcfb42fa5978537
[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         os: [windows-2019, ubuntu-20.04, macos-latest]
14         include:
15           - os: windows-2019
16             pathsep: ";"
17             asset_name: black_windows.exe
18             executable_mime: "application/vnd.microsoft.portable-executable"
19           - os: ubuntu-20.04
20             pathsep: ":"
21             asset_name: black_linux
22             executable_mime: "application/x-executable"
23           - os: macos-latest
24             pathsep: ":"
25             asset_name: black_macos
26             executable_mime: "application/x-mach-binary"
27
28     steps:
29       - uses: actions/checkout@v3
30
31       - name: Set up latest Python
32         uses: actions/setup-python@v3
33         with:
34           python-version: "*"
35
36       - name: Install dependencies
37         run: |
38           python -m pip install --upgrade pip wheel setuptools
39           python -m pip install .
40           python -m pip install pyinstaller
41
42       - name: Build binary
43         run: |
44           python -m PyInstaller -F --name ${{ matrix.asset_name }} --add-data 'src/blib2to3${{ matrix.pathsep }}blib2to3' src/black/__main__.py
45
46       - name: Upload binary as release asset
47         uses: actions/upload-release-asset@v1
48         env:
49           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50         with:
51           upload_url: ${{ github.event.release.upload_url }}
52           asset_path: dist/${{ matrix.asset_name }}
53           asset_name: ${{ matrix.asset_name }}
54           asset_content_type: ${{ matrix.executable_mime }}