mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
Bugfix/correctly package backend job (#1826)
* use makefile to create backend tar in pipeline * correct for multiple architecture builds * move duplication to shared workflow
This commit is contained in:
committed by
GitHub
parent
061a350cc6
commit
abf297d095
2
.github/workflows/backend.yaml
vendored
2
.github/workflows/backend.yaml
vendored
@@ -133,7 +133,7 @@ jobs:
|
|||||||
if: ${{ matrix.target == 'aarch64' }}
|
if: ${{ matrix.target == 'aarch64' }}
|
||||||
|
|
||||||
- name: 'Tar files to preserve file permissions'
|
- name: 'Tar files to preserve file permissions'
|
||||||
run: tar -cvf backend-${{ matrix.target }}.tar ENVIRONMENT.txt GIT_HASH.txt backend/target/${{ matrix.target }}-unknown-linux-gnu/release/embassy*
|
run: make ARCH=${{ matrix.target }} backend-${{ matrix.target }}.tar
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
89
.github/workflows/product.yaml
vendored
89
.github/workflows/product.yaml
vendored
@@ -13,79 +13,32 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
compat:
|
compat:
|
||||||
name: Build compat.tar
|
uses: ./.github/workflows/reusable-workflow.yaml
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 60
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
build_command: make system-images/compat/compat.tar
|
||||||
|
artifact_name: compat.tar
|
||||||
- name: Set up Docker Buildx
|
artifact_path: system-images/compat/compat.tar
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- uses: actions-rs/toolchain@v1
|
|
||||||
with:
|
|
||||||
toolchain: stable
|
|
||||||
override: true
|
|
||||||
|
|
||||||
- uses: actions/cache@v3
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
target/
|
|
||||||
key: ${{ runner.os }}-cargo-compat-${{ hashFiles('**/system-images/compat/Cargo.lock') }}
|
|
||||||
|
|
||||||
- name: Build image
|
|
||||||
run: make system-images/compat/compat.tar
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: compat.tar
|
|
||||||
path: system-images/compat/compat.tar
|
|
||||||
|
|
||||||
utils:
|
utils:
|
||||||
name: Build utils.tar
|
uses: ./.github/workflows/reusable-workflow.yaml
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 60
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
build_command: make system-images/utils/utils.tar
|
||||||
|
artifact_name: utils.tar
|
||||||
- name: Set up Docker Buildx
|
artifact_path: system-images/utils/utils.tar
|
||||||
uses: docker/setup-buildx-action@v1
|
|
||||||
|
|
||||||
- name: Build image
|
|
||||||
run: make system-images/utils/utils.tar
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
|
||||||
name: utils.tar
|
|
||||||
path: system-images/utils/utils.tar
|
|
||||||
|
|
||||||
binfmt:
|
binfmt:
|
||||||
name: Build binfmt.tar
|
uses: ./.github/workflows/reusable-workflow.yaml
|
||||||
runs-on: ubuntu-latest
|
|
||||||
timeout-minutes: 60
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
build_command: make system-images/binfmt/binfmt.tar
|
||||||
|
artifact_name: binfmt.tar
|
||||||
|
artifact_path: system-images/binfmt/binfmt.tar
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
nc-broadcast:
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: ./.github/workflows/reusable-workflow.yaml
|
||||||
|
|
||||||
- name: Build image
|
|
||||||
run: make system-images/binfmt/binfmt.tar
|
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v3
|
|
||||||
with:
|
with:
|
||||||
name: binfmt.tar
|
build_command: make cargo-deps/aarch64-unknown-linux-gnu/release/nc-broadcast
|
||||||
path: system-images/binfmt/binfmt.tar
|
artifact_name: nc-broadcast.tar
|
||||||
|
artifact_path: cargo-deps/aarch64-unknown-linux-gnu/release/nc-broadcast
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
uses: ./.github/workflows/backend.yaml
|
uses: ./.github/workflows/backend.yaml
|
||||||
@@ -97,7 +50,7 @@ jobs:
|
|||||||
name: Build image
|
name: Build image
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 60
|
timeout-minutes: 60
|
||||||
needs: [compat,utils,binfmt,backend,frontend]
|
needs: [compat,utils,binfmt,nc-broadcast,backend,frontend]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
@@ -121,6 +74,12 @@ jobs:
|
|||||||
name: binfmt.tar
|
name: binfmt.tar
|
||||||
path: system-images/binfmt
|
path: system-images/binfmt
|
||||||
|
|
||||||
|
- name: Download nc-broadcast.tar artifact
|
||||||
|
uses: actions/download-artifact@v3
|
||||||
|
with:
|
||||||
|
name: nc-broadcast.tar
|
||||||
|
path: cargo-deps/aarch64-unknown-linux-gnu/release
|
||||||
|
|
||||||
- name: Download js_snapshot artifact
|
- name: Download js_snapshot artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
|
|||||||
34
.github/workflows/reusable-workflow.yaml
vendored
Normal file
34
.github/workflows/reusable-workflow.yaml
vendored
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
name: Reusable Workflow
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_call:
|
||||||
|
inputs:
|
||||||
|
build_command:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
artifact_name:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
artifact_path:
|
||||||
|
required: true
|
||||||
|
type: string
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generic_build_job:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 60
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
submodules: recursive
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
|
- name: Build image
|
||||||
|
run: ${{ inputs.build_command }}
|
||||||
|
|
||||||
|
- uses: actions/upload-artifact@v3
|
||||||
|
with:
|
||||||
|
name: ${{ inputs.artifact_name }}
|
||||||
|
path: ${{ inputs.artifact_path }}
|
||||||
10
Makefile
10
Makefile
@@ -1,6 +1,7 @@
|
|||||||
|
ARCH = aarch64
|
||||||
ENVIRONMENT_FILE := $(shell ./check-environment.sh)
|
ENVIRONMENT_FILE := $(shell ./check-environment.sh)
|
||||||
GIT_HASH_FILE := $(shell ./check-git-hash.sh)
|
GIT_HASH_FILE := $(shell ./check-git-hash.sh)
|
||||||
EMBASSY_BINS := backend/target/aarch64-unknown-linux-gnu/release/embassyd backend/target/aarch64-unknown-linux-gnu/release/embassy-init backend/target/aarch64-unknown-linux-gnu/release/embassy-cli backend/target/aarch64-unknown-linux-gnu/release/embassy-sdk backend/target/aarch64-unknown-linux-gnu/release/avahi-alias
|
EMBASSY_BINS := backend/target/$(ARCH)-unknown-linux-gnu/release/embassyd backend/target/$(ARCH)-unknown-linux-gnu/release/embassy-init backend/target/$(ARCH)-unknown-linux-gnu/release/embassy-cli backend/target/$(ARCH)-unknown-linux-gnu/release/embassy-sdk backend/target/$(ARCH)-unknown-linux-gnu/release/avahi-alias
|
||||||
EMBASSY_UIS := frontend/dist/ui frontend/dist/setup-wizard frontend/dist/diagnostic-ui
|
EMBASSY_UIS := frontend/dist/ui frontend/dist/setup-wizard frontend/dist/diagnostic-ui
|
||||||
EMBASSY_SRC := raspios.img product_key.txt $(EMBASSY_BINS) backend/embassyd.service backend/embassy-init.service $(EMBASSY_UIS) $(shell find build)
|
EMBASSY_SRC := raspios.img product_key.txt $(EMBASSY_BINS) backend/embassyd.service backend/embassy-init.service $(EMBASSY_UIS) $(shell find build)
|
||||||
COMPAT_SRC := $(shell find system-images/compat/ -not -path 'system-images/compat/target/*' -and -not -name compat.tar -and -not -name target)
|
COMPAT_SRC := $(shell find system-images/compat/ -not -path 'system-images/compat/target/*' -and -not -name compat.tar -and -not -name target)
|
||||||
@@ -17,6 +18,7 @@ $(shell sudo true)
|
|||||||
|
|
||||||
.DELETE_ON_ERROR:
|
.DELETE_ON_ERROR:
|
||||||
|
|
||||||
|
.PHONY: all gzip clean format sdk snapshots frontends ui backend
|
||||||
all: eos.img
|
all: eos.img
|
||||||
|
|
||||||
gzip: eos.tar.gz
|
gzip: eos.tar.gz
|
||||||
@@ -99,13 +101,17 @@ patch-db/client/dist: $(PATCH_DB_CLIENT_SRC) patch-db/client/node_modules
|
|||||||
! test -d patch-db/client/dist || rm -rf patch-db/client/dist
|
! test -d patch-db/client/dist || rm -rf patch-db/client/dist
|
||||||
npm --prefix frontend run build:deps
|
npm --prefix frontend run build:deps
|
||||||
|
|
||||||
|
# used by github actions
|
||||||
|
backend-$(ARCH).tar: $(ENVIRONMENT_FILE) $(GIT_HASH_FILE) $(EMBASSY_BINS)
|
||||||
|
tar -cvf $@ $^
|
||||||
|
|
||||||
# this is a convenience step to build all frontends - it is not referenced elsewhere in this file
|
# this is a convenience step to build all frontends - it is not referenced elsewhere in this file
|
||||||
frontends: $(EMBASSY_UIS)
|
frontends: $(EMBASSY_UIS)
|
||||||
|
|
||||||
# this is a convenience step to build the UI
|
# this is a convenience step to build the UI
|
||||||
ui: frontend/dist/ui
|
ui: frontend/dist/ui
|
||||||
|
|
||||||
# this is a convenience step to build the backend
|
# used by github actions
|
||||||
backend: $(EMBASSY_BINS)
|
backend: $(EMBASSY_BINS)
|
||||||
|
|
||||||
cargo-deps/aarch64-unknown-linux-gnu/release/nc-broadcast:
|
cargo-deps/aarch64-unknown-linux-gnu/release/nc-broadcast:
|
||||||
|
|||||||
Reference in New Issue
Block a user