Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 21 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,13 +355,11 @@ jobs:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
# Currently Widnows build fails with
# cargo:warning=# runtime/cgo
# cargo:warning=cgo: C compiler "C:\\Program" not found: exec: "C:\\Program": file does not exist
# error occurred: Command "go" "build" "-buildmode" "c-archive" "-o" "D:\\a\\stackable-cockpit\\stackable-cockpit\\target\\debug\\build\\helm-sys-cce901864d7b6e8c\\out\\libgo-helm-wrapper.a" "go-helm-wrapper/main.go" with args "go-helm-wrapper" did not execute successfully (status code exit code: 1).
# so that Windows build is disabled for now
# Commented out, as Windows build is currently not working
# - target: x86_64-pc-windows-gnu
# os: windows-latest
# - target: x86_64-pc-windows-msvc
# os: windows-latest
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
Expand All @@ -378,7 +376,24 @@ jobs:
- uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 # v2.2.0
with:
key: build-stackablectl-${{ matrix.target }}
- run: cargo build --target ${{ matrix.target }} -p stackablectl
- name: Build for non-Windows
if: matrix.os != 'windows-latest'
run: cargo build --target ${{ matrix.target }} -p stackablectl
# - name: Prepare Windows env
# if: matrix.os == 'windows-latest'
# uses: msys2/setup-msys2@v2
# with:
# msystem: MINGW64
# update: true
# install: base-devel mingw-w64-x86_64-go mingw-w64-x86_64-rust
# # install: base-devel mingw-w64-x86_64-libressl mingw-w64-x86_64-ldns mingw-w64-x86_64-go mingw-w64-x86_64-rust
# - name: Build for Windows
# if: matrix.os == 'windows-latest'
# run: cargo build --target ${{ matrix.target }} -p stackablectl
# shell: msys2 {0}
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: cargo build --target ${{ matrix.target }} -p stackablectl

# Commented out, as this was always failing.
# We can comment it in again once want our image to be certified
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/release_stackablectl.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
---
name: Stackablectl Release Pipeline

on:
push:
tags:
- "stackablectl-[0-9]+.[0-9]+.[0-9]+"

env:
RUST_VERSION: 1.70.0
CARGO_TERM_COLOR: always
CARGO_INCREMENTAL: "0"
CARGO_PROFILE_DEV_DEBUG: "0"
RUSTFLAGS: "-D warnings"
RUSTDOCFLAGS: "-D warnings"
RUST_LOG: "info"

jobs:
release:
name: Release for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-20.04 # We don't use ubuntu-latest because we want to build against an old glibc version. (18.04 has glibc 2.27, 20.04 has glibc 2.31, 22.04 has glibc 2.35)
file-suffix: ""
# Commented out, as Windows build is currently not working
# - target: x86_64-pc-windows-gnu
# os: windows-latest
# file-suffix: ".exe"
- target: x86_64-apple-darwin
os: macos-latest
file-suffix: ""
- target: aarch64-apple-darwin
os: macos-latest
file-suffix: ""
steps:
- name: Checkout
uses: actions/checkout@ac593985615ec2ede58e132d2e21d2b1cbd6127c # v3.3.0
with:
submodules: recursive
- uses: dtolnay/rust-toolchain@0e66bd3e6b38ec0ad5312288c83e47c143e6b09e # v1
with:
toolchain: ${{ env.RUST_VERSION }}
targets: ${{ matrix.target }}
- name: Build for non-Windows
if: matrix.os != 'windows-latest'
run: cargo build --target ${{ matrix.target }} --release -p stackablectl
- name: Prepare Windows env
if: matrix.os == 'windows-latest'
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
update: true
install: base-devel mingw-w64-x86_64-go mingw-w64-x86_64-rust
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: cargo build --target ${{ matrix.target }} --release -p stackablectl
shell: msys2 {0}
- name: Rename binary file
run: mv target/${{ matrix.target }}/release/stackablectl${{ matrix.file-suffix }} stackablectl-${{ matrix.target }}${{ matrix.file-suffix }}
- name: Upload Release binaries
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 # v1
with:
files: stackablectl-${{ matrix.target }}${{ matrix.file-suffix }}
21 changes: 20 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 10 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ nu-ansi-term = "0.49"
phf = "0.11"
phf_codegen = "0.11"
rand = "0.8"
# We use the feature "rustls-tls-native-roots" instead of "rustls-tls" to avoid pulling in "webpki-roots" and hence MPL-2.0: https://github.com/rustls/webpki-roots/blob/main/LICENSE
reqwest = { version = "0.11.16", default-features = false, features = ["rustls-tls-native-roots"] }
reqwest = { version = "0.11.16", default-features = false, features = ["rustls-tls"] }
semver = "1.0"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
Expand All @@ -48,6 +47,13 @@ uuid = { version = "1.4.0", features = ["v4"] }
which = "4.4"

[patch."https://github.com/stackabletech/operator-rs.git"]
# TODO: Switch to released version
# We did not want to draw a release of operator-rs just for https://github.com/stackabletech/operator-rs/pull/634
# stackable-operator = { git = "https://github.com/stackabletech//operator-rs.git", branch = "main" }

[profile.release.package.stackablectl]
# opt-level = "z" # We don't use that as the binary saving is not *that* big (think of 1MB) and it's not worth it risiking performance for this
strip = true
# Cannot use because of https://github.com/rust-lang/cargo/issues/8264#issuecomment-751931213
# lto = true
codegen-units = 1
# Cannot use because of https://github.com/rust-lang/cargo/issues/8264#issuecomment-751931213
# panic = "abort"