![]() You’ll probably want this job to run on both your main branch, as well as workflow_dispatch, just in case you want to manually trigger a rebuild. Setting up GitHub Pages custom buildsīefore starting, make sure in the Pages settings the source is set to “Actions”. This replaced the old workarounds of (force) pushing output to a branch or to separate repository. GitHub has finished moving their pages build infrastructure to Actions, and they now provide the ability to directly push to Pages from Actions. Combined with pipx, composite actions are very easy to write! You can write your own actions locally or in a shared GitHub repo in either GitHub actions syntax itself (called “composite”), JavaScript, or Docker. act: Run GitHub Actions in a docker image locally.It enables you to use any PyPI application in a single line with pipx run. pipx: This is pre-installed on all runners (GitHub uses to set up other things), and is kept up to date.This includes system package managers (like brew, chocolaty, NuGet, Vcpkg, etc), as well as a fantastic cross platform one: There are also a few useful tools installed which can really simplify your workflow or adding custom actions. ruby/setup-ruby Setup Ruby if you need it for something.conda-incubator/setup-miniconda: Setup conda or mamba on GitHub Actions.pre-commit/action: Run pre-commit with built-in caching.pypa/gh-action-pypi-publish: Publish Python packages to PyPI.wntrblm/nox: Setup all versions of Python and provide nox.jwlawson/actions-setup-cmake: Setup any version of CMake on almost any image.ilammy/msvc-dev-cmd: Setup MSVC compilers.actions/download-artifact: Download a file that was previously uploaded, often for releasing.actions/upload-artifact: Upload a file to be accessed from the UI or from a later job.actions/cache: Can store files and restore them on future runs, with a settable key.v4 requires a Python version to be selected. actions/setup-python: Do not use v1 v2+ can setup any Python, including uninstalled ones and pre-releases.v2+ does not keep Git history unless with: fetch-depth: 0 is included (important for SCM versioning). actions/checkout: Almost always the first action.Later steps will see this environment variable. ![]() Metadata syntax: As stated above both Docker and javascript actions require a metadata file with the filename action.yml. GitHub provided a way to do this with dependabot. Github allows you to build Docker and Javascript actions which both require a metadata file with the name of action.yml to define the inputs, outputs and main entry point of your action. If you use non-default actions in your repository (you will see some in the following pages), then it’s a good idea to keep them up to date. The formula here for installing should be identical for all users and using PEP 517/ 518 builds, you are even guaranteed a consistent wheel will be produced just as if you were building a final package. You can also test on other OS’s if you are building any extensions or are worried about your package on macOS or Windows. The matrix should contain the versions you are interested in. name : Test package run : python -m pytest Tests : runs-on : ubuntu-latest strategy : fail-fast : false matrix : python-version : - " 3.7" - " 3.11" name : Check Python $ - name : Install package run : python -m pip install -e.
0 Comments
Leave a Reply. |