Skip to content

Commit

Permalink
Merge pull request #17 from macwinux/feature/build-artifacts-tags
Browse files Browse the repository at this point in the history
test tags
  • Loading branch information
macwinux authored Jun 5, 2024
2 parents 28261ec + da6249e commit b927b09
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 19 deletions.
38 changes: 19 additions & 19 deletions .github/workflows/python-app.yml → .github/workflows/push_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ jobs:
run: |
pytest
pyinstaller:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

- run: pip install -r requirements.txt pyinstaller
- run: pyinstaller -F --paths=dp --add-data="dp/resources:resources" ./dp/dp.py
- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.os }}
path: dist/dp*
# pyinstaller:
# needs: build
# runs-on: ${{ matrix.os }}
# strategy:
# fail-fast: false
# matrix:
# os: ['windows-latest', 'ubuntu-latest', 'macos-latest']
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-python@v5
# with:
# python-version: 3.11
#
# - run: pip install -r requirements.txt pyinstaller
# - run: pyinstaller -F --paths=dp --add-data="dp/resources:resources" ./dp/dp.py
# - uses: actions/upload-artifact@v4
# with:
# name: ${{ matrix.os }}
# path: dist/dp*
62 changes: 62 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

name: release

on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- 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: Test with pytest
run: |
pytest
pyinstaller:
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
artifact_name: dp.exe
asset_name: dp-windows-amd64.exe
- os: ubuntu-latest
artifact_name: dp
asset_name: dp-linux-amd64
- os: macos-latest
artifact_name: dp
asset_name: dp-macos-amd64
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11

- run: pip install -r requirements.txt pyinstaller
- run: pyinstaller -F -n ${{ matrix.artifact_name }} --paths=dp --add-data="dp/resources:resources" ./dp/dp.py
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
tag: ${{ github.ref }}

0 comments on commit b927b09

Please sign in to comment.