Skip to content

Commit

Permalink
Build binaries on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-turbaszek committed Mar 7, 2024
1 parent 829887b commit 66554b4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 27 deletions.
36 changes: 9 additions & 27 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,10 @@ jobs:
include:
- os: macos-latest
TARGET: macos
CMD_BUILD: >
pyinstaller snowcli.spec &&
cd ./dist/snow &&
zip -g ../../snow.zip -r .
ARTIFACT_NAME: snow-${{ github.sha }}-darwin
PATH: snow.zip
- os: windows-latest
TARGET: windows
CMD_BUILD: pyinstaller snowcli.spec
ARTIFACT_NAME: snow-${{ github.sha }}-windows
PATH: ./dist/snow/
- os: ubuntu-latest
TARGET: linux
CMD_BUILD: >
pyinstaller snowcli.spec &&
cd ./dist/snow &&
zip -g ../../snow.zip -r .
ARTIFACT_NAME: snow-${{ github.sha }}-linux
PATH: snow.zip
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -67,18 +52,15 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip check
snow --help
pip install -U pyinstaller
- name: Build with pyinstaller for ${{matrix.TARGET}}
run: ${{matrix.CMD_BUILD}}
- name: Archive python artifact
uses: actions/upload-artifact@v4
with:
name: ${{matrix.ARTIFACT_NAME}}
path: ${{matrix.PATH}}
retention-days: 7
python -m pip install --upgrade hatch
- name: Build with pyapp for ${{matrix.TARGET}}
run: hatch run build:binary
# - name: Archive python artifact
# uses: actions/upload-artifact@v4
# with:
# name: ${{matrix.ARTIFACT_NAME}}
# path: ${{matrix.PATH}}
# retention-days: 7
dev-build:
name: Do dev installation
runs-on: ${{ matrix.os }}
Expand Down
8 changes: 8 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@ test-cov = [
"coverage report",
]

[tool.hatch.envs.build]
detached = "true"
skip-install = "true"

[tool.hatch.envs.build.scripts]
binary = [
"PYAPP_DISTRIBUTION_EMBED=1 PYAPP_FULL_ISOLATION=1 PYAPP_SKIP_INSTALL=1 hatch build -t app"]

[tool.hatch.envs.e2e]
template = "e2e"
features = ["development"]
Expand Down

0 comments on commit 66554b4

Please sign in to comment.