Skip to content

Commit

Permalink
feat: add package.json with version to the debian file
Browse files Browse the repository at this point in the history
  • Loading branch information
mpolitzer committed May 13, 2024
1 parent 2b666d1 commit 21ac6c0
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ jobs:
- name: Create debian package control file
run: make control

- name: Create version file
run: make package.json

- name: Buildx setup
uses: docker/setup-buildx-action@v2

Expand Down
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,13 @@ ARG STAGING_BASE=${BUILD_BASE}/_install
ARG STAGING_DEBIAN=${STAGING_BASE}/DEBIAN
ARG STAGING_SBIN=${STAGING_BASE}/usr/sbin
ARG STAGING_BIN=${STAGING_BASE}/usr/bin
ARG STAGING_SHARE=${STAGING_BASE}/usr/share/machine-emulator-tools

RUN mkdir -p ${STAGING_DEBIAN} ${STAGING_SBIN} ${STAGING_BIN} ${STAGING_BASE}/etc && \
echo "cartesi-machine" > ${staging_base}/etc/hostname

COPY control ${STAGING_DEBIAN}/control
COPY package.json ${STAGING_SHARE}/package.json
COPY postinst ${STAGING_DEBIAN}/postinst

COPY --from=builder ${BUILD_BASE}/tools/sys-utils/cartesi-init/cartesi-init ${STAGING_SBIN}
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ LINUX_HEADERS_URLPATH := https://github.com/cartesi/image-kernel/releases/downlo

all: fs

build: control
build: control package.json
@docker buildx build --load \
--build-arg TOOLS_DEB=$(TOOLS_DEB) \
--build-arg IMAGE_KERNEL_VERSION=$(IMAGE_KERNEL_VERSION) \
Expand All @@ -49,8 +49,10 @@ copy:

$(TOOLS_DEB) deb: build

control: Makefile control.template
@sed 's|ARG_VERSION|$(VERSION)|g' control.template > control
control: Makefile control.in
@sed 's|ARG_VERSION|$(VERSION)|g' control.in > control
package.json: Makefile package.json.in
@sed 's|ARG_VERSION|$(VERSION)|g' package.json.in > package.json

$(TOOLS_ROOTFS) fs: $(TOOLS_DEB)
@docker buildx build --platform=linux/riscv64 \
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions package.json.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "machine-emulator-tools",
"version": "ARG_VERSION"
}

0 comments on commit 21ac6c0

Please sign in to comment.