Skip to content

Commit

Permalink
build wheel in nix script
Browse files Browse the repository at this point in the history
this is mainly so that we have the commands written down outside of
github actions, so we can easily build a hotfix wheel locally
  • Loading branch information
niklasmohrin committed Dec 16, 2024
1 parent 82eb898 commit 416921e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
18 changes: 3 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,8 @@ jobs:
submodules: true
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@main
- run: nix develop .#evap-dev --command bash -c <<EOF
set -ex
npm ci
./manage.py compilemessages
./manage.py scss --production
./manage.py ts compile --fresh
EOF
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: |
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade build
python -m build
- run: nix run .#build-dist
- run: tar tvf dist/*.tar.gz
- run: unzip -l dist/*.whl
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
18 changes: 18 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,24 @@
done
'';
};

build-dist = pkgs.writeShellApplication {
name = "build-dist";
runtimeInputs = with pkgs; [ nodejs gettext git ];
text =
let
python-dev = self.devShells.${system}.evap-dev.passthru.venv;
python-build = self.packages.${system}.python3.withPackages (ps: [ ps.build ]);
in
''
set -x
npm ci
${python-dev}/bin/python ./manage.py compilemessages
${python-dev}/bin/python ./manage.py scss --production
${python-dev}/bin/python ./manage.py ts compile --fresh
${python-build}/bin/python -m build
'';
};
});
};
}

0 comments on commit 416921e

Please sign in to comment.