Skip to content

Updated License and derivatives #16

Updated License and derivatives

Updated License and derivatives #16

name: Build
on:
push:
branches:
- '**'
tags:
- '*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build binaries using pico-sdk
run: |
docker run --rm \
-v ${{ github.workspace }}:/home/dev \
lukstep/raspberry-pi-pico-sdk:latest \
/bin/sh -c \
"cd /home/dev && mkdir build && cd build && cmake .. && make -j4"
- name: Upload binaries
uses: actions/upload-artifact@v2
with:
name: binaries
path: |
build/test/rgbScanTest/rgbScanTest.uf2
build/test/hdmiTest/hdmiTest.uf2
build/test/afeTest/afeTest.uf2
build/test/keyboardTest/keyboardTest.uf2
build/test/storageTest/storageTest.uf2
build/test/securityTest/securityTest.uf2
build/test/graphicsTest/graphicsTest.uf2
build/test/spriteTest/spriteTest.uf2
build/test/guiTest/guiTest.uf2
build/test/integrationTest/integrationTest.uf2
build/test/cmdParserTest/cmdParserTest.uf2
publish:
needs: build
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
steps:
- name: Download binaries
uses: actions/download-artifact@v2
with:
name: binaries
- name: Install tools
run: sudo apt-get install zip jq
- name: Rename and Package binaries
id: package
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
shopt -s nullglob
zip -r -D pico-rgb2hdmi-$TAG_NAME.zip *
echo "zip_file=pico-rgb2hdmi-$TAG_NAME.zip" >> $GITHUB_ENV
- name: Get Release ID
id: get_release
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
upload_url="https://api.github.com/repos/${{ github.repository }}/releases/tags/$TAG_NAME"
RELEASE_ID=$(\
curl \
--silent \
--show-error \
-H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" \
"$upload_url" \
| jq .id)
echo "RELEASE_ID=$RELEASE_ID" >> $GITHUB_ENV
- name: Upload Release Asset
id: upload-release-asset
run: |
upload_url="https://uploads.github.com/repos/${{ github.repository }}/releases/${{ env.RELEASE_ID }}/assets?name=$(basename "${{ env.zip_file }}")"
curl \
-X POST \
-H "Authorization: Bearer ${{ secrets.PUBLIC_REPO_ACCESS_TOKEN }}" \
-H "Content-Type: application/zip" \
--data-binary @${{ env.zip_file }} \
"$upload_url"