Skip to content

Commit

Permalink
build pyinstaller only when we release mapillary_tools (#519)
Browse files Browse the repository at this point in the history
* build pyinstaller only when we release mapillary_tools

* enable binary tests

* rename

* rename script in the workflow

* use github action env

* fix path

* update readme

* fix python versions

* fix windows path

* hey windows

* remove versions
  • Loading branch information
ptpt authored Jul 30, 2022
1 parent ad2c554 commit 8f71f29
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 16 deletions.
33 changes: 22 additions & 11 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,27 +56,38 @@ jobs:
run: |
mypy mapillary_tools
- name: Test with pytest
env:
MAPILLARY_TOOLS_EXECUTABLE: mapillary_tools
run: |
mapillary_tools --version
pytest tests
- name: Build with Pyinstaller on MacOS (Python 3.8 only)
env:
MAPILLARY_TOOLS_EXECUTABLE: mapillary_tools
- name: Build and test with Pyinstaller on MacOS (Python 3.8 only)
# Enable for Python3.8 only because it often fails at codesign (subprocess timeout)
if: matrix.platform == 'macos-latest' && matrix.python-version == 3.8
if: matrix.platform == 'macos-latest' && startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.8
run: |
./script/build
# Could run full integration tests with below but the binary is too slow to start up
# MAPILLARY_TOOLS_EXECUTABLE=./dist/osx/mapillary_tools pytest tests/integration
- name: Build with Pyinstaller on Ubuntu
if: matrix.platform == 'ubuntu-latest' && matrix.python-version == 3.8
./script/build_osx
# Could run full integration tests with the binary (it might be slow)
pytest tests/integration
env:
MAPILLARY_TOOLS_EXECUTABLE: ./dist/osx/mapillary_tools
- name: Build and test with Pyinstaller on Ubuntu (Python 3.8 only)
if: matrix.platform == 'ubuntu-latest' && startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.8
run: |
./script/build_linux
- name: Build with Pyinstaller on Windows
if: matrix.platform == 'windows-latest' && matrix.python-version == 3.8
# Could run full integration tests with the binary (it might be slow)
pytest tests/integration
env:
MAPILLARY_TOOLS_EXECUTABLE: ./dist/linux/mapillary_tools
- name: Build and test with Pyinstaller on Windows (Python 3.8 only)
if: matrix.platform == 'windows-latest' && startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.8
run: |
./script/build_bootloader.ps1
./script/build_win.ps1
# Could run full integration tests with the binary (it might be slow)
cp ./dist/win/mapillary_tools.exe mapillary_tools_WINDOWS_VERY_HARD_TO_FIND_YOU_IN_ANOTHER_DIR_SO_I_MOVE_YOU_HERE.exe
pytest tests/integration
env:
MAPILLARY_TOOLS_EXECUTABLE: mapillary_tools_WINDOWS_VERY_HARD_TO_FIND_YOU_IN_ANOTHER_DIR_SO_I_MOVE_YOU_HERE.exe
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/') && matrix.python-version == 3.8
Expand Down
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -536,9 +536,19 @@ black mapillary_tools tests

Release a new version:
```shell
# assume you are releasing v0.9.0
git tag v0.9.0
# trigger a draft release in CI with binaries built
# Assume you are releasing v0.9.1-beta

# Tag your local branch
# Use -f here to replace the existing one
git tag -f v0.9.1-beta

# Push the tagged commit first if it is not there yet
git push origin

# Push ALL local tags (TODO: How to push a specific tag?)
# Use -f here to replace the existing tags in the remote repo
git push origin --tags -f

# The last step will trigger CI to publish a draft release with binaries built
# in https://github.com/mapillary/mapillary_tools/releases
git push origin --tags
```
```
File renamed without changes.

0 comments on commit 8f71f29

Please sign in to comment.