2023-02-10 09:17:51 -05:00
|
|
|
name: Build mpy-cross
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_call:
|
|
|
|
inputs:
|
|
|
|
cp-version:
|
|
|
|
required: true
|
|
|
|
type: string
|
2023-02-15 10:55:56 -05:00
|
|
|
secrets:
|
|
|
|
AWS_ACCESS_KEY_ID:
|
|
|
|
required: false
|
|
|
|
AWS_SECRET_ACCESS_KEY:
|
|
|
|
required: false
|
2023-02-10 09:17:51 -05:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
mpy-cross: ["static", "static-aarch64", "static-mingw", "static-raspbian"]
|
|
|
|
env:
|
|
|
|
CP_VERSION: ${{ inputs.cp-version }}
|
|
|
|
EX_static-mingw: static.exe
|
|
|
|
OS_static: linux-amd64
|
|
|
|
OS_static-aarch64: linux-aarch64
|
|
|
|
OS_static-mingw: windows
|
|
|
|
OS_static-raspbian: linux-raspbian
|
|
|
|
steps:
|
|
|
|
- name: Set up repository
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
with:
|
|
|
|
submodules: false
|
|
|
|
fetch-depth: 1
|
|
|
|
- name: Set up python
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: 3.x
|
|
|
|
- name: Set up submodules
|
2023-02-11 01:30:27 -05:00
|
|
|
uses: ./.github/actions/deps/submodules
|
2023-02-10 09:17:51 -05:00
|
|
|
with:
|
|
|
|
target: mpy-cross
|
|
|
|
|
|
|
|
- name: Install toolchain (aarch64)
|
|
|
|
if: matrix.mpy-cross == 'static-aarch64'
|
2023-05-20 23:42:30 -04:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y gcc-aarch64-linux-gnu
|
2023-02-10 09:17:51 -05:00
|
|
|
- name: Install toolchain (mingw)
|
|
|
|
if: matrix.mpy-cross == 'static-mingw'
|
2023-05-20 23:42:30 -04:00
|
|
|
run: |
|
|
|
|
sudo apt-get update
|
|
|
|
sudo apt-get install -y mingw-w64
|
2023-02-10 09:17:51 -05:00
|
|
|
|
|
|
|
- name: Build mpy-cross.${{ matrix.mpy-cross }}
|
|
|
|
run: make -C mpy-cross -j2 -f Makefile.${{ matrix.mpy-cross }}
|
|
|
|
|
2023-02-11 01:30:27 -05:00
|
|
|
- name: Set output
|
|
|
|
run: |
|
|
|
|
echo >> $GITHUB_ENV "EX=${{ env[format('EX_{0}', matrix.mpy-cross)] || matrix.mpy-cross }}"
|
|
|
|
echo >> $GITHUB_ENV "OS=${{ env[format('OS_{0}', matrix.mpy-cross)] }}"
|
|
|
|
|
2023-02-10 09:17:51 -05:00
|
|
|
- name: Upload artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
2023-02-11 01:30:27 -05:00
|
|
|
name: mpy-cross.${{ env.EX }}
|
|
|
|
path: mpy-cross/mpy-cross.${{ env.EX }}
|
2023-02-10 09:17:51 -05:00
|
|
|
- name: Upload to S3
|
2023-02-10 12:33:13 -05:00
|
|
|
uses: ./.github/actions/upload_aws
|
|
|
|
with:
|
2023-02-11 01:30:27 -05:00
|
|
|
source: mpy-cross/mpy-cross.${{ env.EX }}
|
|
|
|
destination: mpy-cross/${{ env.OS }}/mpy-cross-${{ env.OS }}-${{ env.CP_VERSION }}.${{ env.EX }}
|
2023-02-10 09:17:51 -05:00
|
|
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
|
|
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|