Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
heiheiyoyo committed Oct 8, 2022
2 parents 6a9753c + 7ecbf4c commit 475b4e4
Showing 1 changed file with 158 additions and 0 deletions.
158 changes: 158 additions & 0 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: Python application

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

permissions:
contents: read

jobs:
build-windows:
runs-on: windows-latest
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pyinstaller
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Make package
run: |
pyinstaller -w -F LANDrop/main.py -i LANDrop/icons/app.ico -n LANDrop --hidden-import _cffi_backend
- name: Upload artifact
uses: actions/[email protected]
with:
name: LANDrop_windows
path: dist/LANDrop.exe
- name: Get version from tag
id: extract_version
run: |
echo ::set-output name=version::${GITHUB_REF_NAME#v}
shell: bash
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/LANDrop.exe
tag: ${{ github.ref_name }}
asset_name: LANDrop-${{ steps.extract_version.outputs.version }}-windows-x64.exe
body: |
PyLANDrop ${{ github.ref_name }}
You can get it from [PyPI](https://pypi.org/project/LANDrop/)
if: startsWith(github.ref_name, 'v') && github.ref_type == 'tag'


build-linux:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
architecture: x64
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pyinstaller
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Make package
run: |
pyinstaller -F LANDrop/main.py -n LANDrop --hidden-import _cffi_backend
- name: Upload artifact
uses: actions/[email protected]
with:
name: LANDrop_linux
path: dist/LANDrop
- name: Get version from tag
id: extract_version
run: |
echo ::set-output name=version::${GITHUB_REF_NAME#v}
shell: bash
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/LANDrop
tag: ${{ github.ref_name }}
asset_name: LANDrop-${{ steps.extract_version.outputs.version }}-linux-x64
body: |
PyLANDrop ${{ github.ref_name }}
You can get it from [PyPI](https://pypi.org/project/LANDrop/)
if: startsWith(github.ref_name, 'v') && github.ref_type == 'tag'
build-macos:
runs-on: macos-latest
outputs:
version: ${{ steps.extract_version.outputs.version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pyinstaller
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Make package
run: |
pyinstaller -w -F LANDrop/main.py -i LANDrop/icons/app.icns -n LANDrop --hidden-import _cffi_backend
- name: Package
working-directory: "./dist"
run: |
zip -r9 --symlinks LANDrop-macos.zip LANDrop.app
- name: Upload artifact
uses: actions/[email protected]
with:
name: LANDrop_macos
path: dist/LANDrop-macos.zip
- name: Get version from tag
id: extract_version
run: |
echo ::set-output name=version::${GITHUB_REF_NAME#v}
shell: bash
- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/LANDrop-macos.zip
tag: ${{ github.ref_name }}
asset_name: LANDrop-${{ steps.extract_version.outputs.version }}-macos.zip
body: |
PyLANDrop ${{ github.ref_name }}
You can get it from [PyPI](https://pypi.org/project/LANDrop/)
if: startsWith(github.ref_name, 'v') && github.ref_type == 'tag'

0 comments on commit 475b4e4

Please sign in to comment.