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

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