Skip to content

Commit bb749a2

Browse files
authored
fix(ci): release package metadata invalid (#101)
1 parent c7af53a commit bb749a2

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.github/workflows/build-release.yaml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ on:
1010
push:
1111
tags:
1212
- '*.*.*'
13+
pull_request:
1314

1415
jobs:
1516
packages:
1617
name: Packages
18+
if: false
1719
strategy:
1820
fail-fast: true
1921
matrix:
@@ -24,14 +26,16 @@ jobs:
2426

2527
image:
2628
name: Image
27-
needs: [packages]
29+
#needs: [packages]
2830
runs-on: ubuntu-latest
2931
strategy:
3032
fail-fast: false
3133
matrix:
3234
model: [lx01, lx06, l09a, l09b]
3335
env:
3436
MODEL: ${{ matrix.model }}
37+
PULL_PACKAGES: false
38+
UPLOAD_RELEASE: false
3539
steps:
3640
- uses: actions/checkout@v4
3741

@@ -69,11 +73,13 @@ jobs:
6973
7074
- name: Pull build packages
7175
uses: actions/download-artifact@v4
76+
if: ${{ env.PULL_PACKAGES == 'true' }}
7277
with:
7378
name: build-${{ matrix.model }}
7479
path: build-packages/targets/
7580

7681
- name: Extract build packages
82+
if: ${{ env.PULL_PACKAGES == 'true' }}
7783
env:
7884
SOURCE_DIR: build-packages/targets
7985
TARGET: build-packages/s2t/armv7
@@ -82,7 +88,7 @@ jobs:
8288
sudo tar xzvf ${SOURCE_DIR}/bin-*.tar.gz -C ${TARGET}
8389
8490
- name: Build artifact
85-
run: sudo make patch build release MODEL=${MODEL}
91+
run: sudo -E make patch build release MODEL=${MODEL}
8692

8793
- name: Prepare artifact
8894
id: artifact
@@ -112,11 +118,21 @@ jobs:
112118
} >> ${GITHUB_STEP_SUMMARY}
113119
114120
- name: Upload artifact to release
121+
if: ${{ env.UPLOAD_RELEASE == 'true' }}
115122
uses: softprops/action-gh-release@v2
116123
with:
117124
files: ${{ steps.artifact.outputs.name }}
118125
draft: true
119126

127+
- name: Upload artifact to Workflow Run
128+
if: ${{ env.UPLOAD_RELEASE == 'false' }}
129+
uses: actions/upload-artifact@v4
130+
with:
131+
name: ${{ steps.artifact.outputs.name }}
132+
path: ${{ steps.artifact.outputs.name }}
133+
retention-days: 10
134+
if-no-files-found: error
135+
120136
- name: Attest Build Provenance
121137
uses: actions/attest-build-provenance@v1
122138
with:

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,11 +97,12 @@ release_set_config:
9797
mkdir -p $(RELEASE_DIR)
9898
@cp -vf $(MICO_VERSION) $(RELEASE_DIR)/metadata
9999
@IMAGE_MD5=$(shell md5sum $(DESTDIR)/$(IMAGE_NAME) | cut -d ' ' -f 1); \
100+
echo "" >> $(RELEASE_DIR)/metadata; \
100101
echo "config core 'hash'" >> $(RELEASE_DIR)/metadata; \
101-
echo -e "\toption ROOTFS '$$IMAGE_MD5'" >> $(RELEASE_DIR)/metadata
102+
printf "\toption ROOTFS '%s'\n" "$$IMAGE_MD5" >> $(RELEASE_DIR)/metadata
102103
ifneq ($(LINUX),none)
103104
@LINUX_MD5=$(shell md5sum $(LINUX) | cut -d ' ' -f 1); \
104-
echo -e "\toption LINUX '$$LINUX_MD5'" >> $(RELEASE_DIR)/metadata
105+
printf "\toption LINUX '%s'\n" "$$LINUX_MD5" >> $(RELEASE_DIR)/metadata
105106
endif
106107

107108
release_pack:

0 commit comments

Comments
 (0)