-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
181 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: usbsas release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
|
||
env: | ||
CARGO_TERM_COLOR: always | ||
|
||
jobs: | ||
build-all: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
toolchain: stable | ||
- name: Build packages and live ISO | ||
run: | | ||
cd debian && \ | ||
docker build -t usbsas-builder:debian -f Dockerfile . && \ | ||
docker run -t -u $(id -u):$(id -g) -v $(pwd)/../:/SRC \ | ||
--env CARGO_HOME=/SRC/target/.cargo usbsas-builder:debian \ | ||
make -C debian pkgs && \ | ||
docker run -t --privileged -v $(pwd)/../:/SRC \ | ||
--env CARGO_HOME=/SRC/target/.cargo usbsas-builder:debian \ | ||
make SU= -C debian | ||
- name: Upload deb packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: usbsas-deb-packages | ||
path: ./target/debian/usbsas-*.deb | ||
- name: Upload live ISO | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: usbsas-live-iso | ||
path: ./client/live-iso/usbsas-*.iso | ||
release: | ||
name: Github release draft | ||
needs: [build-all] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Download usbsas deb packages | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: usbsas-deb-packages | ||
- name: Download usbsas live ISO | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: usbsas-live-iso | ||
- name: Get artifacts names | ||
id: artifacts_names | ||
run: | | ||
echo "U_PKG_ASRV=$(ls usbsas-analyzer-server*.deb)" >> "$GITHUB_OUTPUT" && \ | ||
echo "U_PKG_SRV=$(ls usbsas-server*.deb)" >> "$GITHUB_OUTPUT" && \ | ||
echo "U_PKG_CORE=$(ls usbsas-core*.deb)" >> "$GITHUB_OUTPUT" && \ | ||
echo "U_PKG_KIOSK=$(ls usbsas-kiosk*.deb)" >> "$GITHUB_OUTPUT" && \ | ||
echo "U_PKG_HID=$(ls usbsas-hid*.deb)" >> "$GITHUB_OUTPUT" && \ | ||
echo "U_ISO=$(ls usbsas-*.hybrid.iso)" >> "$GITHUB_OUTPUT" | ||
- name: Create draft release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
draft: true | ||
files: | | ||
${{ steps.artifacts_names.outputs.U_PKG_ASRV }} | ||
${{ steps.artifacts_names.outputs.U_PKG_SRV }} | ||
${{ steps.artifacts_names.outputs.U_PKG_CORE }} | ||
${{ steps.artifacts_names.outputs.U_PKG_KIOSK }} | ||
${{ steps.artifacts_names.outputs.U_PKG_HID }} | ||
${{ steps.artifacts_names.outputs.U_ISO }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.build | ||
cache | ||
chroot* | ||
config/binary | ||
config/bootstrap | ||
config/common | ||
config/hooks/live/0010* | ||
config/hooks/live/0050* | ||
config/hooks/normal | ||
config/includes.chroot/usbsas-*.deb | ||
config/source | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM rust:slim-bullseye | ||
|
||
RUN set -eux; \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
pkgconf \ | ||
clang \ | ||
make \ | ||
cmake \ | ||
curl \ | ||
git \ | ||
protobuf-compiler \ | ||
libfuse3-dev \ | ||
libssl-dev \ | ||
libkrb5-dev \ | ||
libclamav-dev \ | ||
libx11-dev \ | ||
libxtst-dev \ | ||
libdbus-1-dev \ | ||
libudev-dev \ | ||
libseccomp-dev \ | ||
live-build \ | ||
dpkg-dev && \ | ||
cargo install cargo-deb | ||
|
||
WORKDIR /SRC |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ISO_VER=$(shell grep '^version' ../Cargo.toml | cut -d'"' -f2) | ||
|
||
PKG_DIR=../target/debian | ||
|
||
export USBSAS_ISO_VER=$(ISO_VER) | ||
export USBSAS_BIN_PATH=/usr/libexec | ||
export USBSAS_WEBFILES_DIR=/usr/share/usbsas/web | ||
|
||
CORE_VER := $(shell grep '^version = ' ../usbsas-usbsas/Cargo.toml | cut -d'"' -f2) | ||
SRV_VER := $(shell grep '^version = ' ../usbsas-server/Cargo.toml | cut -d'"' -f2) | ||
ASRV_VER := $(shell grep '^version = ' ../usbsas-analyzer-server/Cargo.toml | cut -d'"' -f2) | ||
HID_VER := $(shell grep '^version = ' ../usbsas-hid/hid-dealer/Cargo.toml | cut -d'"' -f2) | ||
KIOSK_VER := $(shell grep 'Version' ../client/kiosk/usbsas-kiosk/DEBIAN/control | cut -d' ' -f2) | ||
|
||
all: ../client/live-iso/usbsas-$(ISO_VER)-amd64.hybrid.iso | ||
|
||
pkgs: $(PKG_DIR)/usbsas-kiosk_$(KIOSK_VER)_amd64.deb \ | ||
$(PKG_DIR)/usbsas-core_$(CORE_VER)_amd64.deb \ | ||
$(PKG_DIR)/usbsas-server_$(SRV_VER)_amd64.deb \ | ||
$(PKG_DIR)/usbsas-analyzer-server_$(ASRV_VER)_amd64.deb \ | ||
$(PKG_DIR)/usbsas-hid_$(HID_VER)_amd64.deb | ||
|
||
$(PKG_DIR)/usbsas-kiosk_$(KIOSK_VER)_amd64.deb: | ||
make -C ../client/kiosk | ||
|
||
$(PKG_DIR)/usbsas-core_$(CORE_VER)_amd64.deb: | ||
cargo build --release --manifest-path=../Cargo.toml | ||
cargo-deb --no-build --manifest-path=../usbsas-usbsas/Cargo.toml | ||
|
||
$(PKG_DIR)/usbsas-server_$(SRV_VER)_amd64.deb: | ||
cargo-deb --no-build --manifest-path=../usbsas-server/Cargo.toml | ||
|
||
$(PKG_DIR)/usbsas-analyzer-server_$(ASRV_VER)_amd64.deb: | ||
cargo build --release --manifest-path=../usbsas-analyzer-server/Cargo.toml | ||
cargo-deb --no-build --manifest-path=../usbsas-analyzer-server/Cargo.toml | ||
|
||
$(PKG_DIR)/usbsas-hid_$(HID_VER)_amd64.deb: | ||
cargo build --release --manifest-path=../usbsas-hid/hid-user/Cargo.toml | ||
cargo build --release --manifest-path=../usbsas-hid/hid-dealer/Cargo.toml | ||
cargo-deb --no-build --manifest-path=../usbsas-hid/hid-dealer/Cargo.toml | ||
|
||
../client/live-iso/usbsas-$(ISO_VER)-amd64.hybrid.iso: pkgs | ||
make -C ../client/live-iso | ||
|
||
clean: | ||
make -C ../client/live-iso clean | ||
make -C ../client/kiosk clean | ||
|
||
distclean: clean | ||
make -C ../client/live-iso distclean | ||
make -C ../client/kiosk distclean | ||
cargo clean --manifest-path=../Cargo.toml |