Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

we now recommend github actions as the CI system of choice #107

Merged
merged 3 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Set up Python 3.7
- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: 3.7
python-version: "3.10"
- name: Versions
run: |
python3 --version
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
38 changes: 9 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,40 +4,20 @@

This repo contains build scripts used to build the
[Adafruit CircuitPython bundle](https://github.com/adafruit/Adafruit_CircuitPython_Bundle), [CircuitPython Community bundle](https://github.com/adafruit/CircuitPython_Community_Bundle)
and individual library release zips. Its focused on Travis CI support but will also work locally
and individual library release zips. Its focused on Github Actions support but will also work locally
when a gcc compiler is present.

The pip package includes mpy-crosses that run on Travis. When building locally, the scripts will
The scripts will either fetch a pre-built mpy-cross from s3 or
automatically clone the [CircuitPython repo](https://github.com/adafruit/circuitpython) and attempt
to build mpy-crosses. You'll need some version of gcc for this to work.
to build mpy-cross. You'll need some version of gcc for this to work.

## Setting up libraries

These build tools are intended for use with [Travis CI](https://travis-ci.org)
to automatically build .mpy files and zip them up for CircuitPython when a new
tagged release is created. To add support to a repo you need to:

1. Use the [CircuitPython cookiecutter](https://github.com/adafruit/cookiecutter-adafruit-circuitpython) to generate .travis.yml.
2. For adafruit repositories, simply give the CircuitPythonLibrarians team
write access to the repo and Adabot will do the rest.

Otherwise, go to travis-ci.org and find the repository (it needs to be
setup to access your github account, and your github account needs access
to write to the repo). Flip the 'ON' switch on for Travis and the repo,
see the Travis docs for more details: https://docs.travis-ci.com/user/getting-started/
3. Get a GitHub 'personal access token' which has at least 'public_repo' or
'repo' scope: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
Keep this token safe and secure! Anyone with the token will be able to
access and write to your GitHub repositories. Travis will use the token
to attach the .mpy files to the release.
4. In the Travis CI settings for the repository that was enabled find the
environment variable editing page: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
Add an environment variable named GITHUB_TOKEN and set it to the value
of the GitHub personal access token above. Keep 'Display value in build
log' flipped off.
5. That's it! Tag a release and Travis should go to work to add zipped .mpy files
to the release. It takes about a 2-3 minutes for a worker to spin up,
build mpy-cross, and add the binaries to the release.
These build tools automatically build .mpy files and zip them up for
CircuitPython when a new tagged release is created. To add support to a repo
you need to use the [CircuitPython
cookiecutter](https://github.com/adafruit/cookiecutter-adafruit-circuitpython)
to generate `.github/workflows/*.yml`.

The bundle build will produce one zip file for every major CircuitPython
release supported containing compatible mpy files and a zip with human readable py files.
Expand Down Expand Up @@ -71,5 +51,5 @@ circuitpython-build-bundles --filename_prefix <output file prefix> --library_loc
## Contributing

Contributions are welcome! Please read our [Code of Conduct]
(https://github.com/adafruit/Adafruit_CircuitPython_adabot/blob/master/CODE_OF_CONDUCT.md)
(https://github.com/adafruit/Adafruit\_CircuitPython\_adabot/blob/master/CODE\_OF\_CONDUCT.md)
before contributing to help this project stay welcoming.
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ requests
semver
wheel
tomli; python_version < "3.11"
importlib_metadata; python_version < "3.8"
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
'circuitpython_build_tools.scripts'],
package_data={'circuitpython_build_tools': ['data/mpy-cross-*']},
zip_safe=False,
python_requires='>=3.7',
python_requires='>=3.10',
install_requires=['Click', 'requests', 'semver', 'tomli; python_version < "3.11"'],
entry_points='''
[console_scripts]
Expand Down