forked from rbreu/beeref
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Migrate to pdm and fix github actions (#4)
* Increment version from v0.3.0 -> v0.3.1 * Migrate to using a pdm file + Add missing dependencies to github workflows + Add flake8 config + Add artifact compression to github workflow + Add GitHub release creation to github workflows
- Loading branch information
1 parent
9e79e29
commit 72961b5
Showing
15 changed files
with
981 additions
and
224 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[flake8] | ||
exclude = .git,.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,98 @@ | ||
name: build | ||
name: Build and Release | ||
|
||
on: workflow_dispatch | ||
on: | ||
workflow_dispatch: {} | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
|
||
build: | ||
name: build | ||
|
||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ['ubuntu-20.04', 'macos-10.15', 'windows-latest'] | ||
os: [ 'ubuntu-22.04', 'macos-11', 'windows-latest' ] | ||
# Currently this is a dummy variable to make the migration to | ||
# multi-arch builds easier in the future | ||
arch: [ 'x86_64' ] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.10' | ||
- name: Install dependencies | ||
|
||
- name: Install Linux dependencies | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt update | ||
sudo apt --yes install qt6-base-dev libgl1-mesa-glx | ||
- name: Install MacOS dependencies | ||
if: runner.os == 'macOS' | ||
run: | | ||
echo "macOS setup" | ||
- name: Install Windows dependencies | ||
if: runner.os == 'Windows' | ||
# Currently pyQt6-Qt6 does not ship with a correctly formatted | ||
# path for RECORD on windows, to workaround this we can run pdm install twice | ||
# and rely on the cached download. | ||
# For more information: https://github.com/pdm-project/pdm/issues/1223 | ||
continue-on-error: true | ||
run: | | ||
pip install pdm | ||
pdm install | ||
- name: Install Python dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install pyinstaller | ||
pip install -e . | ||
pip install pdm | ||
pdm install | ||
- name: Run Pyinstaller | ||
run: pdm run pyinstaller BeeRef.spec | ||
|
||
- name: Compress artifact | ||
shell: bash | ||
env: | ||
ARTIFACT_PATH: dist/BeeRef-${{ github.ref_name }}-${{ runner.os }}-${{ matrix.arch }}.tar.gz | ||
run: | | ||
pyinstaller BeeRef.spec | ||
- name: Upload artifact | ||
APPLICATION_FILE="BeeRef" | ||
if [ "$RUNNER_OS" == "Linux" ]; then | ||
APPLICATION_FILE="$APPLICATION_FILE" | ||
elif [ "$RUNNER_OS" == "macOS" ]; then | ||
APPLICATION_FILE="$APPLICATION_FILE.app" | ||
elif [ "$RUNNER_OS" == "Windows" ]; then | ||
APPLICATION_FILE="$APPLICATION_FILE.exe" | ||
else | ||
echo "Unsupported OS: '$RUNNER_OS'" | ||
exit 1 | ||
fi | ||
echo "Packaging '$APPLICATION_FILE' to '$ARTIFACT_PATH'" | ||
tar --create --gzip --directory "dist" --file="$ARTIFACT_PATH" "$APPLICATION_FILE" | ||
echo "ARTIFACT_PATH=$ARTIFACT_PATH" >> $GITHUB_ENV | ||
- name: Upload temporary artifacts for branch builds | ||
if: startsWith(github.ref, 'refs/heads/') | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: build-${{ matrix.os }} | ||
path: dist/* | ||
retention-days: 5 | ||
path: ${{ env.ARTIFACT_PATH }} | ||
retention-days: 1 | ||
|
||
- name: Upload release artifact | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
allowUpdates: true | ||
omitBodyDuringUpdate: true | ||
omitNameDuringUpdate: true | ||
|
||
generateReleaseNotes: true | ||
name: "${{ github.ref_name }}" | ||
artifacts: "${{ env.ARTIFACT_PATH }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.