|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a single version of Python |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 | + |
| 4 | +name: release |
| 5 | + |
| 6 | +on: |
| 7 | + pull_request: |
| 8 | + branches: [ "master" ] |
| 9 | + |
| 10 | +permissions: |
| 11 | + contents: read |
| 12 | + |
| 13 | +env: |
| 14 | + keymousego-version: _v5_1_1 |
| 15 | + |
| 16 | +jobs: |
| 17 | + build-windows: |
| 18 | + runs-on: windows-latest |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@main |
| 21 | + - name: Set up Python 3.7 |
| 22 | + uses: actions/setup-python@main |
| 23 | + with: |
| 24 | + python-version: "3.7" |
| 25 | + - name: Install dependencies |
| 26 | + run: | |
| 27 | + pip3 install -r requirements-windows.txt |
| 28 | + pip3 install pyinstaller |
| 29 | + - name: Bundle Packages |
| 30 | + run: | |
| 31 | + pyinstaller -Fw --add-data './assets;assets' KeymouseGo.py |
| 32 | + - name: Copy artifact |
| 33 | + run: | |
| 34 | + mkdir artifact && mv dist/KeymouseGo.exe ./artifact/KeymouseGo${{ env.keymousego-version }}-win.exe |
| 35 | + - name: Artifact |
| 36 | + uses: actions/upload-artifact@main |
| 37 | + with: |
| 38 | + name: windows |
| 39 | + path: ${{ github.workspace }}/artifact/ |
| 40 | + |
| 41 | + build-linux: |
| 42 | + runs-on: ubuntu-latest |
| 43 | + steps: |
| 44 | + - uses: actions/checkout@main |
| 45 | + - name: Set up Python 3.7 |
| 46 | + uses: actions/setup-python@main |
| 47 | + with: |
| 48 | + python-version: "3.7" |
| 49 | + - name: Install dependencies |
| 50 | + run: | |
| 51 | + pip3 install -r requirements-universal.txt |
| 52 | + pip3 install pyinstaller |
| 53 | + - name: Bundle Packages |
| 54 | + run: | |
| 55 | + pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py |
| 56 | + - name: Copy artifact |
| 57 | + run: | |
| 58 | + mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-linux |
| 59 | + - name: Artifact |
| 60 | + uses: actions/upload-artifact@main |
| 61 | + with: |
| 62 | + name: linux |
| 63 | + path: ${{ github.workspace }}/artifact/ |
| 64 | + |
| 65 | + build-macos: |
| 66 | + runs-on: macos-latest |
| 67 | + steps: |
| 68 | + - uses: actions/checkout@main |
| 69 | + - name: Set up Python 3.7 |
| 70 | + uses: actions/setup-python@main |
| 71 | + with: |
| 72 | + python-version: "3.7" |
| 73 | + - name: Install dependencies |
| 74 | + run: | |
| 75 | + pip3 install -r requirements-universal.txt |
| 76 | + pip3 install pyinstaller |
| 77 | + - name: Bundle Packages |
| 78 | + run: | |
| 79 | + pyinstaller -Fw --add-data './assets:assets' KeymouseGo.py |
| 80 | + - name: Copy artifact |
| 81 | + run: | |
| 82 | + mkdir artifact && mv dist/KeymouseGo ./artifact/KeymouseGo${{ env.keymousego-version }}-mac |
| 83 | + - name: Artifact |
| 84 | + uses: actions/upload-artifact@main |
| 85 | + with: |
| 86 | + name: macos |
| 87 | + path: ${{ github.workspace }}/artifact/ |
0 commit comments