build.yml
1 name: Build CI 2 3 on: [pull_request, push] 4 5 jobs: 6 test: 7 runs-on: ubuntu-latest 8 steps: 9 - name: Dump GitHub context 10 env: 11 GITHUB_CONTEXT: ${{ toJson(github) }} 12 run: echo "$GITHUB_CONTEXT" 13 - name: Translate Repo Name For Build Tools filename_prefix 14 id: repo-name 15 run: | 16 echo ::set-output name=repo-name::$( 17 echo ${{ github.repository }} | 18 awk -F '\/' '{ print tolower($2) }' | 19 tr '_' '-' 20 ) 21 - name: Set up Python 3.6 22 uses: actions/setup-python@v1 23 with: 24 python-version: 3.6 25 - name: Versions 26 run: | 27 python3 --version 28 - uses: actions/checkout@v1 29 with: 30 submodules: true 31 - name: Install deps 32 run: | 33 sudo apt-get install -y gettext gawk 34 pip install -r requirements.txt 35 - name: Library version 36 run: git describe --dirty --always --tags 37 - name: Package Folder Prefix For circuitpython-build-tools (Community Bundle Specific) 38 id: pkg-folder 39 run: | 40 echo ::set-output name=prefix::$( 41 ls -RUx | 42 gawk -F '\n' '{ match($1, /(drivers|helpers)\/(.+)\/(.+)\:/, arr) ; if (length(arr[0]) > 0 && match(arr[3], arr[2]) > 0) printf "%s, ", arr[3] }' | 43 gawk '{ trimmed = substr($0, 1, length($0) - 2) ; print "\"" trimmed "\"" }' 44 ) 45 - name: Build assets 46 run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location libraries --library_depth 2 --package_folder_prefix ${{ steps.pkg-folder.outputs.prefix }}