Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): deprecate openssl-tls feature #469

Merged
merged 3 commits into from
Feb 10, 2024
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
159 changes: 4 additions & 155 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

env:
CARGO_TERM_COLOR: always
OPENSSL_VERSION: OpenSSL_1_1_1s

jobs:
build:
Expand Down Expand Up @@ -53,157 +52,13 @@ jobs:
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: ${{ matrix.target }}-rustls
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/kubetui.exe

- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: ${{ matrix.target }}-rustls
path: target/${{ matrix.target }}/release/kubetui

build-windows:
runs-on: windows-latest

env:
TARGET: x86_64-pc-windows-msvc

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: echo "OPENSSL_DIR=$env:VCPKG_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: |-
echo "OPENSSL_LIB_DIR=$env:OPENSSL_DIR\lib" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "OPENSSL_INCLUDE_DIR=$env:OPENSSL_DIR\include" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: vcpkg install openssl:x64-windows-static

- uses: dtolnay/rust-toolchain@stable

- run: cargo build --release --no-default-features --features openssl-tls --target $env:TARGET

- uses: actions/upload-artifact@v4
with:
name: ${{ env.TARGET }}-openssl
path: target/${{ env.TARGET }}/release/kubetui.exe

build-linux:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl

runs-on: ubuntu-latest

env:
OPENSSL_DIR: /opt/openssl
OPENSSL_INCLUDE_DIR: /opt/openssl/include
OPENSSL_LIB_DIR: /opt/openssl/lib
OPENSSL_STATIC: true
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Packages
run: |
sudo apt-get install libssl-dev

- name: Make OpenSSL
if: matrix.target == 'x86_64-unknown-linux-musl'
env:
OPENSSL_DIR: /opt/openssl
OPENSSL_INCLUDE_DIR: /opt/openssl/include
OPENSSL_LIB_DIR: /opt/openssl/lib
run: |
sudo apt-get update
sudo apt-get install musl-tools linux-headers-generic

sudo ln -sv /usr/include/linux /usr/include/x86_64-linux-musl/linux
sudo ln -sv /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm
sudo ln -sv /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic

mkdir /tmp/build
cd /tmp/build

curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf -

export CC=musl-gcc

./Configure linux-x86_64 --prefix=$OPENSSL_DIR -fPIC no-shared

make depend
make -j
make install_sw

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build
run: |
if [[ "${{ matrix.target }}" != "x86_64-unknown-linux-musl" ]]; then
unset OPENSSL_DIR
unset OPENSSL_LIB_DIR
unset OPENSSL_INCLUDE_DIR
unset OPENSSL_STATIC
fi
cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }}

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-openssl
path: target/${{ matrix.target }}/release/kubetui

build-macos:
runs-on: macos-latest

strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
include:
- target: x86_64-apple-darwin
openssl: darwin64-x86_64-cc
- target: aarch64-apple-darwin
openssl: darwin64-arm64-cc
env:
OPENSSL_DIR: /tmp/openssl
OPENSSL_INCLUDE_DIR: /tmp/openssl/include
OPENSSL_LIB_DIR: /tmp/openssl/lib
OPENSSL_STATIC: true

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Make OpenSSL
run: |
mkdir /tmp/openssl-build
cd /tmp/openssl-build

curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf -

./Configure ${{ matrix.openssl }} --prefix=$OPENSSL_DIR -fPIC no-shared

make depend
make -j
make install_sw

- run: cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }}

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-openssl
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/kubetui

release:
Expand All @@ -215,9 +70,6 @@ jobs:
- x86_64-pc-windows-msvc
- x86_64-apple-darwin
- aarch64-apple-darwin
feature:
- openssl
- rustls
include:
- target: x86_64-unknown-linux-gnu
artifact_name: kubetui
Expand All @@ -238,21 +90,18 @@ jobs:
runs-on: ubuntu-latest

needs:
- build-windows
- build-linux
- build-macos
- build

steps:
- name: Download binaries
uses: actions/download-artifact@v4
with:
name: ${{ matrix.target }}-${{ matrix.feature }}
name: ${{ matrix.target }}

- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.artifact_name }}
asset_name: kubetui-${{ matrix.target }}-${{ matrix.feature }}${{ matrix.file_ext }}
asset_name: kubetui-${{ matrix.target }}${{ matrix.file_ext }}
tag: ${{ github.ref }}
149 changes: 2 additions & 147 deletions .github/workflows/upload-artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:

env:
CARGO_TERM_COLOR: always
OPENSSL_VERSION: OpenSSL_1_1_1s

jobs:
build:
Expand Down Expand Up @@ -53,155 +52,11 @@ jobs:
- uses: actions/upload-artifact@v4
if: matrix.os == 'windows-latest'
with:
name: ${{ matrix.target }}-rustls
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/kubetui.exe

- uses: actions/upload-artifact@v4
if: matrix.os != 'windows-latest'
with:
name: ${{ matrix.target }}-rustls
path: target/${{ matrix.target }}/release/kubetui

build-windows:
runs-on: windows-latest

env:
TARGET: x86_64-pc-windows-msvc

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: echo "OPENSSL_DIR=$env:VCPKG_ROOT\installed\x64-windows-static" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: |-
echo "OPENSSL_LIB_DIR=$env:OPENSSL_DIR\lib" | Out-File -FilePath $env:GITHUB_ENV -Append
echo "OPENSSL_INCLUDE_DIR=$env:OPENSSL_DIR\include" | Out-File -FilePath $env:GITHUB_ENV -Append

- run: vcpkg install openssl:x64-windows-static

- uses: dtolnay/rust-toolchain@stable

- run: cargo build --release --no-default-features --features openssl-tls --target $env:TARGET

- uses: actions/upload-artifact@v4
with:
name: ${{ env.TARGET }}-openssl
path: target/${{ env.TARGET }}/release/kubetui.exe

build-linux:
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-unknown-linux-musl

runs-on: ubuntu-latest

env:
OPENSSL_DIR: /opt/openssl
OPENSSL_INCLUDE_DIR: /opt/openssl/include
OPENSSL_LIB_DIR: /opt/openssl/lib
OPENSSL_STATIC: true
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- name: Install Packages
run: |
sudo apt-get install libssl-dev

- name: Make OpenSSL
if: matrix.target == 'x86_64-unknown-linux-musl'
env:
OPENSSL_DIR: /opt/openssl
OPENSSL_INCLUDE_DIR: /opt/openssl/include
OPENSSL_LIB_DIR: /opt/openssl/lib
run: |
sudo apt-get update
sudo apt-get install musl-tools linux-headers-generic

sudo ln -sv /usr/include/linux /usr/include/x86_64-linux-musl/linux
sudo ln -sv /usr/include/x86_64-linux-gnu/asm /usr/include/x86_64-linux-musl/asm
sudo ln -sv /usr/include/asm-generic /usr/include/x86_64-linux-musl/asm-generic

mkdir /tmp/build
cd /tmp/build

curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf -

export CC=musl-gcc

./Configure linux-x86_64 --prefix=$OPENSSL_DIR -fPIC no-shared

make depend
make -j
make install_sw

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Build
run: |
if [[ "${{ matrix.target }}" != "x86_64-unknown-linux-musl" ]]; then
unset OPENSSL_DIR
unset OPENSSL_LIB_DIR
unset OPENSSL_INCLUDE_DIR
unset OPENSSL_STATIC
fi
cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }}

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-openssl
path: target/${{ matrix.target }}/release/kubetui

build-macos:
runs-on: macos-latest

strategy:
matrix:
target:
- x86_64-apple-darwin
- aarch64-apple-darwin
include:
- target: x86_64-apple-darwin
openssl: darwin64-x86_64-cc
- target: aarch64-apple-darwin
openssl: darwin64-arm64-cc
env:
OPENSSL_DIR: /tmp/openssl
OPENSSL_INCLUDE_DIR: /tmp/openssl/include
OPENSSL_LIB_DIR: /tmp/openssl/lib
OPENSSL_STATIC: true

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Make OpenSSL
run: |
mkdir /tmp/openssl-build
cd /tmp/openssl-build

curl -L https://github.com/openssl/openssl/archive/${{ env.OPENSSL_VERSION }}.tar.gz | tar --strip-components=1 -xzf -

./Configure ${{ matrix.openssl }} --prefix=$OPENSSL_DIR -fPIC no-shared

make depend
make -j
make install_sw

- run: cargo build --release --no-default-features --features openssl-tls --target ${{ matrix.target }}

- uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}-openssl
name: ${{ matrix.target }}
path: target/${{ matrix.target }}/release/kubetui
Loading