Skip to content

Commit

Permalink
fix(ci): release package metadata invalid (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
duhow authored Dec 30, 2024
1 parent c7af53a commit bb749a2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/build-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ on:
push:
tags:
- '*.*.*'
pull_request:

jobs:
packages:
name: Packages
if: false
strategy:
fail-fast: true
matrix:
Expand All @@ -24,14 +26,16 @@ jobs:

image:
name: Image
needs: [packages]
#needs: [packages]
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
model: [lx01, lx06, l09a, l09b]
env:
MODEL: ${{ matrix.model }}
PULL_PACKAGES: false
UPLOAD_RELEASE: false
steps:
- uses: actions/checkout@v4

Expand Down Expand Up @@ -69,11 +73,13 @@ jobs:
- name: Pull build packages
uses: actions/download-artifact@v4
if: ${{ env.PULL_PACKAGES == 'true' }}
with:
name: build-${{ matrix.model }}
path: build-packages/targets/

- name: Extract build packages
if: ${{ env.PULL_PACKAGES == 'true' }}
env:
SOURCE_DIR: build-packages/targets
TARGET: build-packages/s2t/armv7
Expand All @@ -82,7 +88,7 @@ jobs:
sudo tar xzvf ${SOURCE_DIR}/bin-*.tar.gz -C ${TARGET}
- name: Build artifact
run: sudo make patch build release MODEL=${MODEL}
run: sudo -E make patch build release MODEL=${MODEL}

- name: Prepare artifact
id: artifact
Expand Down Expand Up @@ -112,11 +118,21 @@ jobs:
} >> ${GITHUB_STEP_SUMMARY}
- name: Upload artifact to release
if: ${{ env.UPLOAD_RELEASE == 'true' }}
uses: softprops/action-gh-release@v2
with:
files: ${{ steps.artifact.outputs.name }}
draft: true

- name: Upload artifact to Workflow Run
if: ${{ env.UPLOAD_RELEASE == 'false' }}
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact.outputs.name }}
path: ${{ steps.artifact.outputs.name }}
retention-days: 10
if-no-files-found: error

- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
with:
Expand Down
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,12 @@ release_set_config:
mkdir -p $(RELEASE_DIR)
@cp -vf $(MICO_VERSION) $(RELEASE_DIR)/metadata
@IMAGE_MD5=$(shell md5sum $(DESTDIR)/$(IMAGE_NAME) | cut -d ' ' -f 1); \
echo "" >> $(RELEASE_DIR)/metadata; \
echo "config core 'hash'" >> $(RELEASE_DIR)/metadata; \
echo -e "\toption ROOTFS '$$IMAGE_MD5'" >> $(RELEASE_DIR)/metadata
printf "\toption ROOTFS '%s'\n" "$$IMAGE_MD5" >> $(RELEASE_DIR)/metadata
ifneq ($(LINUX),none)
@LINUX_MD5=$(shell md5sum $(LINUX) | cut -d ' ' -f 1); \
echo -e "\toption LINUX '$$LINUX_MD5'" >> $(RELEASE_DIR)/metadata
printf "\toption LINUX '%s'\n" "$$LINUX_MD5" >> $(RELEASE_DIR)/metadata
endif

release_pack:
Expand Down

0 comments on commit bb749a2

Please sign in to comment.