2023-02-01 00:48:37 +00:00
|
|
|
name: Build all packages
|
|
|
|
|
|
|
|
on: [push, pull_request]
|
|
|
|
|
2023-02-24 07:06:25 +00:00
|
|
|
env:
|
|
|
|
PACKAGE_INDEX_PATH: /tmp/micropython-lib-deploy
|
|
|
|
|
2023-02-01 00:48:37 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
- uses: actions/setup-python@v1
|
|
|
|
- name: Setup environment
|
|
|
|
run: source tools/ci.sh && ci_build_packages_setup
|
|
|
|
- name: Check manifest files
|
|
|
|
run: source tools/ci.sh && ci_build_packages_check_manifest
|
|
|
|
- name: Compile package index
|
|
|
|
run: source tools/ci.sh && ci_build_packages_compile_index
|
2023-07-24 00:26:05 +00:00
|
|
|
- name: Compile package examples
|
|
|
|
run: source tools/ci.sh && ci_build_packages_examples
|
tools/ci.sh: Support publishing package and index files to GitHub Pages.
Opt-in feature to make it easier for folks to test packages that are still
in development, open in Pull Requests, or even in independent forks.
---
To enable this on your own GitHub fork of the micropython-lib repository
then navigate to the fork's "Settings" -> "Secrets and variables" ->
"Actions" -> "Variables" page, then click "New repository variable", and
create a variable named MIP_INDEX with value true (or any "truthy" value).
Once enabled then any time a branch is pushed to your fork and builds
successfully, GitHub Actions will also push the built packages and package
index to the gh-pages branch which is associated with the repo's GitHub
Pages web site. The packages can then be installed remotely via:
mpremote mip --index \
https://USERNAME.github.io/micropython-lib/mip/BRANCH_NAME PACKAGE_NAME
or on a device as:
mip.install(PACKAGE_NAME, index="https://USERNAME.github.io/micropython-lib/mip/BRANCHNAME")
(Replace USERNAME, BRANCH_NAME and PACKAGE_NAME as applicable. If you've
renamed your fork, change the name micropython-lib to match.)
Note: As well as the MIP_INDEX repository variable, this functionality
depends on both GitHub Actions and GitHub Pages being enabled on your
repository in GitHub. However both options should enable automatically,
unless they have been manually disabled.
This work was funded through GitHub Sponsors.
2023-02-20 02:54:55 +00:00
|
|
|
- name: Publish packages for branch
|
|
|
|
if: vars.MICROPY_PUBLISH_MIP_INDEX && github.event_name == 'push' && ! github.event.deleted
|
|
|
|
run: source tools/ci.sh && ci_push_package_index
|
2023-02-24 07:06:25 +00:00
|
|
|
- name: Upload packages as artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: packages-${{ github.sha }}
|
|
|
|
path: ${{ env.PACKAGE_INDEX_PATH }}
|