mirror of
https://github.com/Garmelon/PFERD.git
synced 2023-12-21 10:23:01 +01:00
Set up build and release workflow
This commit is contained in:
parent
86ba47541b
commit
d8bd1f518a
78
.github/workflows/build-and-release.yml
vendored
Normal file
78
.github/workflows/build-and-release.yml
vendored
Normal file
@ -0,0 +1,78 @@
|
||||
name: build-and-release
|
||||
|
||||
on: push
|
||||
|
||||
defaults:
|
||||
run:
|
||||
shell: bash
|
||||
|
||||
jobs:
|
||||
|
||||
build:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macos-latest]
|
||||
python: ["3.8"]
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- uses: actions/setup-python@v2
|
||||
with:
|
||||
python-version: ${{ matrix.python }}
|
||||
|
||||
- name: Set up project
|
||||
if: matrix.os != 'windows-latest'
|
||||
run: ./scripts/setup
|
||||
|
||||
- name: Set up project on windows
|
||||
if: matrix.os == 'windows-latest'
|
||||
# For some reason, `pip install --upgrade pip` doesn't work on
|
||||
# 'windows-latest'. The installed pip version works fine however.
|
||||
run: ./scripts/setup --no-pip
|
||||
|
||||
- name: Run checks
|
||||
run: ./scripts/check
|
||||
|
||||
- name: Build
|
||||
run: ./scripts/build
|
||||
|
||||
- name: Rename binary
|
||||
# Glob in source location because on windows pyinstaller creates a file
|
||||
# named "pferd.exe"
|
||||
run: mv dist/pferd* dist/pferd-${{ matrix.os }}
|
||||
|
||||
- name: Upload binary
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: Binaries
|
||||
path: dist/pferd-${{ matrix.os }}
|
||||
|
||||
release:
|
||||
runs-on: ubuntu-latest
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
needs: build
|
||||
steps:
|
||||
|
||||
- name: Download binaries
|
||||
uses: actions/download-artifact@v2
|
||||
with:
|
||||
name: Binaries
|
||||
|
||||
- name: Rename binaries
|
||||
run: |
|
||||
mv pferd-ubuntu-latest pferd-linux
|
||||
mv pferd-windows-latest pferd-windows.exe
|
||||
mv pferd-macos-latest pferd-mac
|
||||
|
||||
- name: Create release
|
||||
uses: softprops/action-gh-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
files: |
|
||||
pferd-linux
|
||||
pferd-windows.exe
|
||||
pferd-mac
|
@ -2,7 +2,16 @@
|
||||
|
||||
set -e
|
||||
|
||||
pip install --upgrade pip setuptools
|
||||
# Updating pip and setuptools because some older versions don't recognize the
|
||||
# project setup correctly
|
||||
if [[ $1 != '--no-pip' ]]; then
|
||||
pip install --upgrade pip
|
||||
fi
|
||||
pip install --upgrade setuptools
|
||||
|
||||
# Installing PFERD itself
|
||||
pip install --editable .
|
||||
|
||||
# Installing various tools
|
||||
pip install --upgrade mypy flake8 autopep8 isort
|
||||
pip install --upgrade pyinstaller
|
||||
|
Loading…
Reference in New Issue
Block a user