From 1dbbd24bbc58b875fed9f2dc80ecf85ffe77063e Mon Sep 17 00:00:00 2001 From: Ivan Zorin Date: Wed, 20 Dec 2023 04:42:27 +0300 Subject: [PATCH] push.yml: upload_metadata: download prebuilt artifacts, generate jsons, upload them as metadata.zip - Work in Progress --- .github/workflows/push.yml | 40 +++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 05b07bbe..98269b71 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -72,6 +72,7 @@ jobs: steps: - name: Install dependencies (apk) run: apk add --no-cache gcc-riscv-none-elf newlib-riscv-none-elf findutils python3 py3-pip make git bash musl-dev + - name: Install dependencies (python) run: python3 -m pip install bdflib @@ -117,21 +118,46 @@ jobs: upload_metadata: needs: [build, build_multi-lang] runs-on: ubuntu-20.04 - steps: + container: + image: alpine:3.16 + strategy: + matrix: + model: ["TS100", "TS80", "TS80P", "Pinecil", "MHP30", "Pinecilv2", "S60", "TS101", "Pinecil_multi-lang", "Pinecilv2_multi-lang"] + fail-fast: true - - name: Download All JSONs + steps: + - name: Install dependencies (apk) + run: apk add --no-cache findutils python3 py3-pip make git bash + + - name: Install dependencies (python) + run: python3 -m pip install bdflib + + - uses: actions/checkout@v4 + with: + submodules: true + + - name: Git ownership exception + run: git config --global --add safe.directory /__w/IronOS/IronOS && git config --global safe.directory "$GITHUB_WORKSPACE" + + - name: Git meta info + run: echo "GITHUB_CI_PR_SHA=${{github.event.pull_request.head.sha}}" >> "${GITHUB_ENV}" + + - name: Download all prebuilts uses: actions/download-artifact@v4 with: - path: metadata - pattern: .metadata-* + path: source/Hexfile/ + pattern: * merge-multiple: true - - run: ls -R metadata + - run: ls -R source/Hexfile - - name: Re-upload JSONs in bulk + - name: Generate JSON files + run: ./source/metadata.py ${{ matrix.model }}.json + + - name: Upload JSONs in bulk as metadata uses: actions/upload-artifact@v4 with: name: metadata - path: metadata/* + path: source/Hexfile/*.json if-no-files-found: error