Skip to content

Commit 973f7c3

Browse files
authored
Absolute bare-bones CI (#180)
1 parent 896a502 commit 973f7c3

File tree

3 files changed

+67
-120
lines changed

3 files changed

+67
-120
lines changed

.github/workflows/ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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+

builder.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "aws-iot-device-sdk-js-v2",
3+
"imports": [
4+
"nodejs"
5+
],
6+
"deps_dir": "deps",
7+
8+
"build_steps": [
9+
"npm install"
10+
]
11+
}

package-lock.json

Lines changed: 6 additions & 120 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)