Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,18 @@ jobs:
run: |
echo EXTRA_ZEPHYR_MODULES="$(pwd)/$MODULE_PATH" >> $GITHUB_ENV

- name: Build fade
- name: Apply Zephyr patches
run: |
west build -p -b arduino_nano_33_ble//sense $MODULE_PATH/samples/fade
bash $MODULE_PATH/extra/apply_zephyr_patches.sh

- name: Build i2cdemo
- name: Build blinky
run: |
west build -p -b ek_ra8d1 $MODULE_PATH/samples/i2cdemo
west build -p -b kit_pse84_ai/pse846gps2dbzc4a/m33 $MODULE_PATH/samples/blinky_arduino

- name: Build adc
- name: Build hello
run: |
west build -p -b arduino_nano_33_ble/nrf52840/sense $MODULE_PATH/samples/analog_input
west build -p -b kit_pse84_ai/pse846gps2dbzc4a/m33 $MODULE_PATH/samples/hello_arduino

- name: Build threads
run: |
west build -p -b kit_pse84_ai/pse846gps2dbzc4a/m33 $MODULE_PATH/samples/threads_arduino
15 changes: 15 additions & 0 deletions .github/workflows/package_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,21 @@ jobs:
tar xf ${CORE_ARTIFACT} # will create ArduinoCore-zephyr/
echo "REPORT_FILE=$(echo ${FQBN} | tr ':' '-').json" >> $GITHUB_ENV

- name: Install arm-zephyr-eabi 1.0.1 for zephyr_contrib boards
# zephyr_contrib boards (e.g. kit_pse84_ai) use Zephyr 4.4.0 + SDK 1.0.1.
# The Board Manager only ships arm-zephyr-eabi-0.16.8 (for SDK 0.16.8/Zephyr 4.2.0).
# We install 1.0.1 manually into the arduino-cli packages path so that
# {runtime.tools.arm-zephyr-eabi-1.0.1.path} resolves correctly during compilation.
if: ${{ matrix.subarch == 'zephyr_contrib' }}
run: |
TOOL_DIR=~/.arduino15/packages/zephyr/tools/arm-zephyr-eabi/1.0.1
if [ ! -d "$TOOL_DIR/bin" ]; then
mkdir -p "$TOOL_DIR"
wget -q https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v1.0.1/toolchain_gnu_linux-x86_64_arm-zephyr-eabi.tar.xz -O /tmp/arm-zephyr-eabi.tar.xz
tar -xf /tmp/arm-zephyr-eabi.tar.xz -C "$TOOL_DIR" --strip-components=1
rm /tmp/arm-zephyr-eabi.tar.xz
fi

- name: Get test sketches
run: |
# sets ALL_TESTS and ALL_LIBRARIES env vars in GITHUB_ENV
Expand Down
171 changes: 171 additions & 0 deletions .github/workflows/release_pse84.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Copyright (c) Arduino s.r.l. and/or its affiliated companies
# SPDX-License-Identifier: Apache-2.0

# PSE84-specific release workflow: triggered automatically when package_core.yml
# completes successfully on main. Bumps the version, tags the commit, and
# publishes the ArduinoCore-zephyr_contrib package as a GitHub Release.

name: Release PSE84

on:
workflow_run:
workflows: ["Package, test and upload core"]
types: [completed]
branches: [main]

jobs:

bump-version-and-tag:
name: Bump version, tag, and create release
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' && endsWith(github.repository, '/ArduinoCore-zephyr') && github.triggering_actor != 'github-actions[bot]' }}
permissions:
contents: write
outputs:
release_tag: ${{ steps.release_tag.outputs.release_tag }}
steps:

- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true

- name: Compute next release tag
id: release_tag
env:
RELEASE_BUMP: patch
run: |
git fetch --tags

EXISTING_TAG=$(git tag --points-at "${{ github.event.workflow_run.head_sha }}" --list '[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n1)
if [ -n "${EXISTING_TAG}" ]; then
echo "Using existing tag on HEAD: ${EXISTING_TAG}"
echo "release_tag=${EXISTING_TAG}" >> "$GITHUB_OUTPUT"
exit 0
fi

LAST_TAG=$(git tag --list '[0-9]*.[0-9]*.[0-9]*' --sort=-v:refname | head -n1)
if [ -z "${LAST_TAG}" ]; then
LAST_TAG="0.0.0"
fi

IFS='.' read -r MAJOR MINOR PATCH <<< "${LAST_TAG}"
case "${RELEASE_BUMP}" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
*)
PATCH=$((PATCH + 1))
;;
esac

NEW_TAG="${MAJOR}.${MINOR}.${PATCH}"
echo "release_tag=${NEW_TAG}" >> "$GITHUB_OUTPUT"

- name: Create release (and tag if missing)
env:
GH_TOKEN: ${{ github.token }}
TAG: ${{ steps.release_tag.outputs.release_tag }}
run: |
if gh release view "${TAG}" >/dev/null 2>&1; then
echo "Release ${TAG} already exists"
else
gh release create "${TAG}" \
--target "${{ github.event.workflow_run.head_sha }}" \
--title "ArduinoCore-zephyr-pse84 ${TAG}" \
--notes "Automated release for ${{ github.event.workflow_run.head_sha }}."
fi


publish-pse84-release:
name: Publish PSE84 release assets
runs-on: ubuntu-latest
needs:
- bump-version-and-tag
if: ${{ needs.bump-version-and-tag.result == 'success' }}
permissions:
contents: write
actions: read
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
TAG: ${{ needs.bump-version-and-tag.outputs.release_tag }}
steps:

- uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
fetch-tags: true

- name: Download zephyr_contrib artifact from triggering workflow run
uses: actions/download-artifact@v8
with:
pattern: ArduinoCore-zephyr_contrib-*
path: release-assets
merge-multiple: true
run-id: ${{ github.event.workflow_run.id }}
github-token: ${{ secrets.GITHUB_TOKEN }}

- name: Normalize artifact filename for release tag
run: |
if [ -z "${TAG}" ]; then
echo "Release tag is empty" >&2
exit 1
fi

TAR_FILE=$(ls release-assets/ArduinoCore-zephyr_contrib-*.tar.bz2 | head -n1)
if [ -z "${TAR_FILE}" ]; then
echo "Downloaded artifact does not contain expected tarball" >&2
exit 1
fi

OLD_BASENAME=$(basename "${TAR_FILE}")
NEW_BASENAME="ArduinoCore-zephyr_contrib-${TAG}.tar.bz2"

if [ "${OLD_BASENAME}" != "${NEW_BASENAME}" ]; then
mv "${TAR_FILE}" "release-assets/${NEW_BASENAME}"
echo "Renamed ${OLD_BASENAME} -> ${NEW_BASENAME}"
fi

echo "TAR_BASENAME=${NEW_BASENAME}" >> "$GITHUB_ENV"

- name: Generate package index JSON
run: |
ARTIFACT_PATH="release-assets/${TAR_BASENAME}"
SIZE=$(wc -c < "${ARTIFACT_PATH}")
SHA256=$(sha256sum "${ARTIFACT_PATH}" | cut -d' ' -f1)
URL="https://github.com/${GH_REPO}/releases/download/${TAG}/${TAR_BASENAME}"

python3 - <<EOF
import json

with open("package/package_infineon_pse84_index.template.json") as f:
idx = json.load(f)

p = idx["packages"][0]["platforms"][0]
p["version"] = "${TAG}"
p["archiveFileName"] = "${TAR_BASENAME}"
p["url"] = "${URL}"
p["checksum"] = "SHA-256:${SHA256}"
p["size"] = "${SIZE}"

with open("release-assets/package_infineon_pse84_index.json", "w") as f:
json.dump(idx, f, indent=2)
EOF

- name: Create or update GitHub Release assets
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ env.TAG }}
name: ArduinoCore-zephyr-pse84 ${{ env.TAG }}
overwrite_files: true
files: |
release-assets/${{ env.TAR_BASENAME }}
release-assets/package_infineon_pse84_index.json
67 changes: 67 additions & 0 deletions .github/workflows/repackage_toolchain_windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Repackage Windows Toolchain

# The Zephyr SDK only ships arm-zephyr-eabi for Windows as .7z, which Arduino
# CLI does not support. This workflow downloads the .7z, repacks it as .tar.xz,
# and uploads it to the specified GitHub release of this repo — the same
# approach Arduino uses for their own hosted toolchains.
#
# Run this once after creating a new release tag, then fill in the checksum and
# size printed at the end into the Windows entry of the package index template.

on:
workflow_dispatch:
inputs:
sdk_version:
description: 'Zephyr SDK version (e.g. 1.0.1)'
required: true
default: '1.0.1'
release_tag:
description: 'Release tag to upload the artifact to (e.g. 0.1.6)'
required: true

permissions: {}

jobs:
repackage:
runs-on: windows-latest
permissions:
contents: write # needed to upload files to a GitHub Release
steps:
- name: Download arm-zephyr-eabi .7z
run: |
$version = "${{ github.event.inputs.sdk_version }}"
$url = "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${version}/toolchain_gnu_windows-x86_64_arm-zephyr-eabi.7z"
Write-Host "Downloading $url"
Invoke-WebRequest -Uri $url -OutFile "toolchain.7z"

- name: Extract .7z
run: 7z x toolchain.7z -o"toolchain_extracted" -y

- name: Repack as .tar.xz
run: |
$version = "${{ github.event.inputs.sdk_version }}"
$tarName = "toolchain_gnu_windows-x86_64_arm-zephyr-eabi-${version}.tar.xz"
tar -cJf $tarName -C toolchain_extracted .
echo "TAR_NAME=$tarName" >> $env:GITHUB_ENV

- name: Compute SHA-256 and size
run: |
$hash = (Get-FileHash -Algorithm SHA256 $env:TAR_NAME).Hash.ToLower()
$size = (Get-Item $env:TAR_NAME).Length
echo "TAR_SHA256=$hash" >> $env:GITHUB_ENV
echo "TAR_SIZE=$size" >> $env:GITHUB_ENV

- name: Upload to GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.event.inputs.release_tag }}
files: ${{ env.TAR_NAME }}

- name: Print package index values
run: |
Write-Host ""
Write-Host "=== Paste these into the Windows entry of the package index template ==="
Write-Host "archiveFileName : $env:TAR_NAME"
Write-Host "url : https://github.com/${{ github.repository }}/releases/download/${{ github.event.inputs.release_tag }}/$env:TAR_NAME"
Write-Host "checksum : SHA-256:$env:TAR_SHA256"
Write-Host "size : $env:TAR_SIZE"
Loading
Loading