Fixes GitHub CI

wch-ch32v003
Felix "xq" Queißner 9 months ago
parent 6eccd8fd95
commit 2f6a61e6ae

@ -1,4 +1,5 @@
name: Build name: Continuous Integration
on: on:
push: push:
branches: [main] branches: [main]
@ -6,33 +7,32 @@ on:
branches: [main] branches: [main]
jobs: jobs:
build: generate-packages:
runs-on: ${{ matrix.os }} runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dir:
- all-platforms
- raspberrypi-rp2040
- espressif-esp
- nxp-lpc
- microchip-atmega
- gigadevice-gd32
- nordic-nrf5x
- stmicro-stm32
os:
- windows-latest
- macos-latest
- ubuntu-latest
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v4
with:
fetch-tags: true # required for "git describe"
- name: Fetch more data from git
run: |
# fetch everything back till the 0.11.0 tag.
# https://stackoverflow.com/a/58082274
git fetch --shallow-exclude 0.11.0
git fetch --deepen=2
- name: Setup Zig - name: Setup Zig
uses: goto-bus-stop/setup-zig@v2 uses: goto-bus-stop/setup-zig@v2
with: with:
version: 0.11.0 version: 0.11.0
- name: Build examples - name: Generate and validate packages
working-directory: ${{ matrix.dir }} run: |
run: zig build ./tools/bundle.sh
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: packages
path: microzig-deploy/

@ -5,14 +5,14 @@
# Creates all packages into /microzig-deploy with the final folder structure. # Creates all packages into /microzig-deploy with the final folder structure.
# #
set -euo pipefail set -eu
all_files_dir=".data" all_files_dir=".data"
# test for all required tools: # test for all required tools:
which zig date find jq mkdir dirname realpath > /dev/null which zig date find jq mkdir dirname realpath > /dev/null
[ "$(zig version)" == "0.11.0" ] [ "$(zig version)" = "0.11.0" ]
repo_root="$(dirname "$(dirname "$(realpath "$0")")")" repo_root="$(dirname "$(dirname "$(realpath "$0")")")"
[ -d "${repo_root}" ] [ -d "${repo_root}" ]
@ -32,7 +32,7 @@ git_description="$(git describe --match "*.*.*" --tags --abbrev=9)"
version="" version=""
# render-version <major> <minor> <patch> <counter> <hash> # render-version <major> <minor> <patch> <counter> <hash>
function render_version() render_version()
{ {
[ "$#" -eq 5 ] [ "$#" -eq 5 ]
echo "$1.$2.$3-$4-$5" echo "$1.$2.$3-$4-$5"
@ -132,7 +132,7 @@ for dir in $(find -type f -name microzig-package.json -exec dirname '{}' ';'); d
create_package "${dir}" "${out_path}" create_package "${dir}" "${out_path}"
# get some required metadata # get some required metadata
file_hash=($(sha256sum "${out_path}" | cut -f 1)) file_hash="$(sha256sum "${out_path}" | cut -d " " -f 1)"
file_size="$(stat --format="%s" "${out_path}")" file_size="$(stat --format="%s" "${out_path}")"
pkg_info="$(archive_info ${out_path})" pkg_info="$(archive_info ${out_path})"

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -euo pipefail set -eu
# test for all required tools: # test for all required tools:
which tar gzip jq basename dirname realpath > /dev/null which tar gzip jq basename dirname realpath > /dev/null

Loading…
Cancel
Save