From b99d2eb6f34ac4efcb2678f76e8254f15950b905 Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Mon, 14 Dec 2020 17:20:14 +0100 Subject: [PATCH 1/2] Package the core with ArduinoCore-API latest release --- .github/workflows/release.yaml | 50 +++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 01ad1899c..074654182 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,6 +13,36 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 + - name: Get Latest Release + id: latest_API_version + uses: abatilo/release-info-action@v1.3.0 + with: + owner: arduino + repo: ArduinoCore-API + + - name: Set ArduinoCore-API latest version as env variable + run: | + echo "LATEST_TAG_API=$(echo ${{ steps.latest_API_version.outputs.latest_tag }})" >> $GITHUB_ENV + + - name: Checkout ArduinoCore-API + uses: actions/checkout@v2 + with: + repository: arduino/ArduinoCore-API + ref: ${{ env.LATEST_TAG_API }} + path: extras/ArduinoCore-API + + - name: Check if API should be compiled in the core + id: checkapi + run: | + if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi + + - name: Integrate ArduinoCore-API + run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" + if: steps.checkapi.outputs.IS_API == 'true' + + - name: Remove ArduinoCore-API + run: rm -r "$GITHUB_WORKSPACE/extras/ArduinoCore-API" + - name: Set env run: echo "TAG_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV @@ -52,7 +82,7 @@ jobs: with: version: "0.14.0" - - name: Download new core + - name: Download and verify new core run: | export PATH=$PATH:$PWD arduino-cli version @@ -63,24 +93,6 @@ jobs: arduino-cli config dump -v arduino-cli core update-index -v arduino-cli core install arduino:${ARCHITECTURE}@${TAG_VERSION} - - - name: Checkout ArduinoCore-API - uses: actions/checkout@v2 - with: - repository: arduino/ArduinoCore-API - path: extras/ArduinoCore-API - - - name: Check if API should be compiled in the core - id: checkapi - run: | - if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi - - - name: Integrate ArduinoCore-API - run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/packages/arduino/hardware/${ARCHITECTURE}/${TAG_VERSION}/cores/arduino" - if: steps.checkapi.outputs.IS_API == 'true' - - - name: Verify new core - run: | INDEX=0 arduino-cli board listall --format=json > boardlist.json N=$(jq '.boards | length' boardlist.json) From 4c15cd01abecc12a94628ddaf3c57fd4bf3c380d Mon Sep 17 00:00:00 2001 From: giulcioffi Date: Tue, 15 Dec 2020 10:16:00 +0100 Subject: [PATCH 2/2] Checkout ArduinoCore-API latest tag, even without GitHub release --- .github/workflows/release.yaml | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 074654182..d7e23178f 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -13,22 +13,10 @@ jobs: - name: Checkout repository uses: actions/checkout@v2 - - name: Get Latest Release - id: latest_API_version - uses: abatilo/release-info-action@v1.3.0 - with: - owner: arduino - repo: ArduinoCore-API - - - name: Set ArduinoCore-API latest version as env variable - run: | - echo "LATEST_TAG_API=$(echo ${{ steps.latest_API_version.outputs.latest_tag }})" >> $GITHUB_ENV - - name: Checkout ArduinoCore-API uses: actions/checkout@v2 with: repository: arduino/ArduinoCore-API - ref: ${{ env.LATEST_TAG_API }} path: extras/ArduinoCore-API - name: Check if API should be compiled in the core @@ -36,8 +24,13 @@ jobs: run: | if [[ $(grep -r api platform.txt) ]]; then echo "::set-output name=IS_API::true"; fi - - name: Integrate ArduinoCore-API - run: mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" + - name: Checkout latest tag of ArduinoCore-API and add it to the core + run: | + cd extras/ArduinoCore-API + git fetch --tags + git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) + cd ../.. + mv "$GITHUB_WORKSPACE/extras/ArduinoCore-API/api" "$GITHUB_WORKSPACE/cores/arduino" if: steps.checkapi.outputs.IS_API == 'true' - name: Remove ArduinoCore-API