Skip to content

Commit f7e91f2

Browse files
committed
Add travis CI config for auto release generation.
1 parent 0a0401a commit f7e91f2

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.travis.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Travis CI configuration for automated .mpy file generation.
2+
# Version: 2.0 (support for both .mpy and packages)
3+
# Author: Tony DiCola
4+
# License: Public Domain
5+
# This configuration will work with Travis CI (travis-ci.org) to automacially
6+
# build .mpy files and packages for MicroPython when a new tagged release is
7+
# created. This file is relatively generic and can be shared across multiple
8+
# repositories by following these steps:
9+
# 1. Copy this file into a .travis.yml file in the root of the repository.
10+
# 2. Change the deploy > file section below to list each of the .mpy files or
11+
# package .zip files that should be generated.
12+
# For each .mpy file listed the config will automatically look for .py files
13+
# with the same name as the source for generating the .mpy files. Note that
14+
# the .mpy extension should be lower case!
15+
# For each .zip file listed the config will assume a folder with the same
16+
# name exists (minus the .zip extension) and will recursively walk the folder
17+
# to generate .mpy versions of all .py files EXCEPT __init__.py (not supported
18+
# right now because of a bug). Then a zip of the directory will be generated
19+
# with just the .mpy and __init__.py files.
20+
# 3. Commit the .travis.yml file and push it to GitHub.
21+
# 4. Go to travis-ci.org and find the repository (it needs to be setup to access
22+
# your github account, and your github account needs access to write to the
23+
# repo). Flip the 'ON' switch on for Travis and the repo, see the Travis
24+
# docs for more details: https://docs.travis-ci.com/user/getting-started/
25+
# 5. Get a GitHub 'personal access token' which has at least 'public_repo' or
26+
# 'repo' scope: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
27+
# Keep this token safe and secure! Anyone with the token will be able to
28+
# access and write to your GitHub repositories. Travis will use the token
29+
# to attach the .mpy files to the release.
30+
# 6. In the Travis CI settings for the repository that was enabled find the
31+
# environment variable editing page: https://docs.travis-ci.com/user/environment-variables/#Defining-Variables-in-Repository-Settings
32+
# Add an environment variable named GITHUB_TOKEN and set it to the value
33+
# of the GitHub personal access token above. Keep 'Display value in build
34+
# log' flipped off.
35+
# 7. That's it! Tag a release and Travis should go to work to add .mpy files
36+
# to the release. It takes about a 2-3 minutes for a worker to spin up,
37+
# build mpy-cross, and add the binaries to the release.
38+
language: generic
39+
40+
sudo: true
41+
42+
deploy:
43+
provider: releases
44+
api_key: $GITHUB_TOKEN
45+
file:
46+
- adafruit_bus_device.zip
47+
skip_cleanup: true
48+
on:
49+
tags: true
50+
51+
before_install:
52+
- wget https://raw.githubusercontent.com/adafruit/MicroPython_TravisCI_Deploy/master/install_dependencies.sh
53+
- source install_dependencies.sh
54+
55+
before_deploy:
56+
- wget https://raw.githubusercontent.com/adafruit/MicroPython_TravisCI_Deploy/master/build_release.sh
57+
- ./build_release.sh

0 commit comments

Comments
 (0)