Skip to content

introduction of macroArg command #1458

introduction of macroArg command

introduction of macroArg command #1458

Workflow file for this run

name: CI
on:
push:
branches:
- master*
- staging*
tags:
- "*"
pull_request:
branches:
- master*
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-24.04
timeout-minutes: 25
env:
ARM_GCC_DIR: /usr
steps:
- uses: actions/checkout@v6
with:
path: firmware
submodules: recursive
ref: ${{ github.event.pull_request.head.sha || github.ref }}
- name: Install build dependencies
run: |
sudo apt-get install -y gcc-arm-none-eabi
- name: Install west
run: pip3 install --user -U west
- name: Install python dependencies of scripts
run: |
cd firmware/scripts
pip install -r requirements.txt
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: firmware
manifest-file-name: west_nrfsdk.yml
toolchains: arm-zephyr-eabi
sdk-version: 0.17.4
- name: Git user setup
run: |
git config --global user.email "git-patch@uhk.com"
git config --global user.name "Git Patch"
- name: West patch
run: west patch
- name: West config
run: |
west config build.cmake-args -- "-Wno-dev"
west config build.board_warn false
west config build.device_warn false
- name: mcuxsdk west setup
run: |
west config manifest.file west_mcuxsdk.yml
west update
west patch
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v6
with:
node-version-file: firmware/scripts/.nvmrc
- name: Install node dependencies in scripts folder
working-directory: firmware/scripts
run: npm install
- name: Create firmware tarball
working-directory: firmware
run: node scripts/make-release.mjs --allowSha
- name: Upload firmware artifacts
uses: actions/upload-artifact@v7
with:
name: firmware
path: firmware/scripts/uhk-firmware-*.tar.gz
archive: false
retention-days: 90
- name: Run build-archiver
uses: UltimateHackingKeyboard/build-archiver@v0.0.9
if: github.repository == 'UltimateHackingKeyboard/firmware' && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork == false)
with:
FILE_PATTERN: "firmware/scripts/uhk-firmware-*.tar.gz"
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
S3_ACCESS_KEY: ${{ secrets.UHK_BUILD_ARCHIVER_B2_ACCESS_SECRET }}
S3_ACCESS_KEY_ID: ${{ secrets.UHK_BUILD_ARCHIVER_B2_ACCESS_KEY }}
S3_BUCKET: "uhk-build-archives"
S3_ENDPOINT: https://s3.us-east-005.backblazeb2.com
S3_KEY_PREFIX: "firmware/"
S3_REGION: "us-east-005"
- name: Check whether tag is a version
id: version_check
if: github.ref_type == 'tag'
run: |
if [[ "${{ github.ref_name }}" =~ ^v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "is_version=true" >> $GITHUB_OUTPUT
else
echo "is_version=false" >> $GITHUB_OUTPUT
fi
- name: Strip `v` from git tag and
if: steps.version_check.outputs.is_version == 'true'
run: |
TAG_VERSION=${{ github.ref_name }}
TAG_VERSION=${TAG_VERSION#v}
echo "TAG_VERSION=$TAG_VERSION" >> $GITHUB_ENV
- name: Extract changelog
id: changelog
if: steps.version_check.outputs.is_version == 'true'
env:
VERSION: ${{ env.TAG_VERSION }}
run: |
cd firmware
DELIMITER=$(openssl rand -hex 16)
echo "content<<$DELIMITER" >> $GITHUB_OUTPUT
sed -n "/^## \\[${VERSION}\\]/,/^## \\[/p" CHANGELOG.md | sed '$d' | tail -n +3 >> $GITHUB_OUTPUT
echo "$DELIMITER" >> $GITHUB_OUTPUT
- name: Release
uses: softprops/action-gh-release@v3
if: steps.version_check.outputs.is_version == 'true'
with:
body: ${{ steps.changelog.outputs.content }}
draft: true
name: ${{ env.TAG_VERSION }}
files: firmware/scripts/uhk-firmware-*.tar.gz
token: ${{ secrets.GITHUB_TOKEN }}