|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - '*' |
| 7 | + - '!main' |
| 8 | + |
| 9 | +env: |
| 10 | + BUILDER_VERSION: v0.8.19 |
| 11 | + BUILDER_SOURCE: releases |
| 12 | + BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net |
| 13 | + PACKAGE_NAME: aws-iot-device-sdk-js-v2 |
| 14 | + LINUX_BASE_IMAGE: ubuntu-16-x64 |
| 15 | + RUN: ${{ github.run_id }}-${{ github.run_number }} |
| 16 | + AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} |
| 17 | + AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |
| 18 | + AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }} |
| 19 | + |
| 20 | +jobs: |
| 21 | + |
| 22 | + al2: |
| 23 | + runs-on: ubuntu-latest |
| 24 | + steps: |
| 25 | + # We can't use the `uses: docker://image` version yet, GitHub lacks authentication for actions -> packages |
| 26 | + - name: Build ${{ env.PACKAGE_NAME }} |
| 27 | + run: | |
| 28 | + echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u awslabs --password-stdin |
| 29 | + export DOCKER_IMAGE=docker.pkg.github.com/awslabs/aws-crt-builder/aws-crt-al2-x64:${{ env.BUILDER_VERSION }} |
| 30 | + docker pull $DOCKER_IMAGE |
| 31 | + docker run --env GITHUB_REF $DOCKER_IMAGE build -p ${{ env.PACKAGE_NAME }} |
| 32 | +
|
| 33 | + windows: |
| 34 | + runs-on: windows-latest |
| 35 | + steps: |
| 36 | + - name: Build ${{ env.PACKAGE_NAME }} |
| 37 | + run: | |
| 38 | + python -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" |
| 39 | + python builder.pyz build -p ${{ env.PACKAGE_NAME }} |
| 40 | +
|
| 41 | + osx: |
| 42 | + runs-on: macos-latest |
| 43 | + steps: |
| 44 | + - name: Build ${{ env.PACKAGE_NAME }} |
| 45 | + run: | |
| 46 | + python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder')" |
| 47 | + chmod a+x builder |
| 48 | + ./builder build -p ${{ env.PACKAGE_NAME }} |
| 49 | +
|
| 50 | +
|
0 commit comments