Skip to content

Commit

Permalink
Gist support.
Browse files Browse the repository at this point in the history
  • Loading branch information
floitsch committed Jul 19, 2023
1 parent 83e47c4 commit da876e4
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ on:
description: Variant to build
required: false
type: string
gist:
description: Link to gist with variant files
required: false
type: string

jobs:
build:
Expand Down Expand Up @@ -107,24 +111,44 @@ jobs:
run: |
VARIANTS=${{ github.event.inputs.variant }}
if [ -z "$VARIANTS" ]; then
VARIANTS=$(build/envelope-tool list)
if [ $? -ne 0 ]; then
echo "Failed to list variants"
exit 1
if [ -z "${{ github.event.inputs.gist }}" ]; then
VARIANTS="gist"
else
VARIANTS=$(build/envelope-tool list)
if [ $? -ne 0 ]; then
echo "Failed to list variants"
exit 1
fi
fi
fi
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "VARIANTS<<$EOF" >> $GITHUB_ENV
echo "$VARIANTS" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
echo "VARIANTS_ROOT=variants" >> $GITHUB_ENV
- name: Synthesize Gist variant
if: ${{ github.event.inputs.gist }}
run: |
mkdir -p "gist-variant/$VARIANTS"
cd "gist-variant/$VARIANTS"
GIST=${{ github.event.inputs.gist }}
FILES=$(gh gist view --files "$GIST")
for f in $FILES; do
gh gist view --raw --filename "$f" > "$f"
done
echo "VARIANTS_ROOT=gist-variant/$VARIANTS" >> $GITHUB_ENV
cd ../..
file gist-variant
- name: Synthesize the variants
if: ${{ ! github.event.inputs.gist }}
run: |
build/envelope-tool synthesize \
--toit-root=toit \
--output-root=synthesized \
--sdk-path=build/host/sdk \
--variants-root=variants \
--variants-root=$VARIANTS_ROOT \
--build-root=build \
$VARIANTS
Expand Down

0 comments on commit da876e4

Please sign in to comment.