Added arm and windows builds

This commit is contained in:
Joe Bellus 2022-02-10 22:50:27 -05:00
parent b6bceb3ff8
commit 141dc6d224
2 changed files with 52 additions and 7 deletions

View File

@ -14,7 +14,7 @@ test:
- mkdir dist
- touch dist/index.html
- apt-get update
- apt-get -y install libssl-dev pkg-config
- apt-get -y install pkg-config
- cargo test
build-ui:
@ -25,8 +25,8 @@ build-ui:
- apt-get -y install libssl-dev
- npm install
- npm run build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
artifacts:
paths:
- dist/
@ -34,7 +34,6 @@ build-ui:
build-bin:
dependencies:
- build-ui
image: "rust:slim-buster"
stage: build
tags:
@ -54,7 +53,9 @@ build-bin:
- vade-linux-x64.tar.gz
build-docker-bin:
build-musl-bin:
dependencies:
- build-ui
stage: build
image: 'rust:latest'
script:
@ -62,13 +63,49 @@ build-docker-bin:
- apt update && apt install -y musl-tools musl-dev
- update-ca-certificates
- cargo build --target x86_64-unknown-linux-musl --release
- cd target/x86_64-unknown-linux-musl/release/
- tar -czf ../../../vade-linux-musl.tar.gz vade
- cd ../../../
artifacts:
paths:
- target/x86_64-unknown-linux-musl/release/vade
build-rp:
dependencies:
- build-ui
stage: build
image: 'rust:latest'
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- rustup target add armv7-unknown-linux-gnueabihf
- apt update
- apt install gcc-arm-linux-gnueabihf
- cd target/armv7-unknown-linux-gnueabihf/release/
- tar -czf ../../../vade-linux-arm.tar.gz vade
- cd ../../../
artifacts:
paths:
- target/armv7-unknown-linux-gnueabihf/release/vade
build-win:
dependencies:
- build-ui
stage: build
tags:
- windows
# rules:
# - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- cargo build --release
artifacts:
paths:
- target/release/vade.exe
build-docker:
dependencies:
- build-docker-bin
- build-musl-bin
stage: build-docker
image: docker:latest
script:
@ -81,13 +118,18 @@ build-docker:
deploy-binaries:
dependencies:
- build-bin
- build-musl
- build-rp
- build-win
image: curlimages/curl:latest
stage: deploy
rules:
- if: $CI_COMMIT_TAG
script:
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-x64.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-arm.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./vade-linux-musl.tar.gz "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ./target/release/vade.exe "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/bin/$CI_COMMIT_TAG/vade-linux-x64-$CI_COMMIT_TAG.tar.gz"'
release:
stage: release

View File

@ -30,3 +30,6 @@ sqlx = { version = "^0.5", features=["sqlite", "migrate"] }
[target.'cfg(all(target_env = "musl", target_pointer_width = "64"))'.dependencies.jemallocator]
version = "0.3"
[target.armv7-unknown-linux-gnueabihf]
linker = "arm-linux-gnueabihf-gcc"