Skip to content

Commit 0ccf336

Browse files
committed
ci - fixing musl build
- reqwest is now building with native-tls-vendored feature to resolve issues with openssl not being detected properly - we will generate the targets before creating the actual github release
1 parent a6f3bf1 commit 0ccf336

File tree

3 files changed

+65
-19
lines changed

3 files changed

+65
-19
lines changed

.github/workflows/ci.yml

Lines changed: 54 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ env:
1313

1414
jobs:
1515
test:
16+
name: Running Tests
1617
runs-on: ubuntu-latest
1718
steps:
1819
- name: Checkout Repo
@@ -32,8 +33,54 @@ jobs:
3233
env:
3334
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
3435
run: cargo caw-publish
35-
github_release_create:
36+
cargo_build:
3637
needs: test
38+
name: Cargo - Building Artifacts
39+
runs-on: ubuntu-latest
40+
strategy:
41+
matrix:
42+
build:
43+
- linux gnu x86_64
44+
- linux musl x64
45+
include:
46+
- build: linux musl x64
47+
os: ubuntu-latest
48+
rust: stable
49+
rust_target: x86_64-unknown-linux-musl
50+
- build: linux gnu x86_64
51+
os: ubuntu-latest
52+
rust: stable
53+
rust_target: x86_64-unknown-linux-gnu
54+
steps:
55+
- name: Checkout Repo
56+
uses: actions/checkout@v4
57+
58+
- name: Ubuntu - Install Dependencies - musl
59+
if: matrix.rust_target == 'x86_64-unknown-linux-musl'
60+
run: |
61+
sudo apt-get install -y musl-tools libssl-dev pkg-config perl gcc
62+
63+
- name: Rustup - Install Dependencies - musl
64+
if: matrix.rust_target == 'x86_64-unknown-linux-musl'
65+
run: |
66+
rustup target add x86_64-unknown-linux-musl
67+
68+
- name: Build
69+
run: cargo build -r --target ${{ matrix.rust_target }}
70+
71+
- name: Adjust Target Name
72+
run: |
73+
cp \
74+
target/${{ matrix.rust_target }}/release/http_status_code_check \
75+
target/${{ matrix.rust_target }}/release/http_status_code_check-${{ matrix.rust_target }}
76+
77+
- name: Upload Artifact
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: ${{ matrix.rust_target }}
81+
path: target/${{ matrix.rust_target }}/release/http_status_code_check-${{ matrix.rust_target }}
82+
github_release_create:
83+
needs: cargo_build
3784
name: Github Release - Creating Release
3885
runs-on: ubuntu-latest
3986
outputs:
@@ -79,27 +126,16 @@ jobs:
79126
- name: Checkout Repo
80127
uses: actions/checkout@v4
81128

82-
- name: Install Dependencies - musl
83-
if: matrix.rust_target == 'x86_64-unknown-linux-musl'
84-
run: |
85-
sudo apt-get install -y --no-install-recommends musl-tools libssl-dev
86-
rustup target add x86_64-unknown-linux-musl
87-
88-
- name: Build
89-
run: cargo build -r --target ${{ matrix.rust_target }}
90-
91-
- name: Adjust Target Name
92-
run: |
93-
cp \
94-
target/${{ matrix.rust_target }}/release/http_status_code_check \
95-
target/${{ matrix.rust_target }}/release/http_status_code_check-${{ matrix.rust_target }}
129+
- uses: actions/download-artifact@v4
130+
name: Downloading Target
131+
with:
132+
name: ${{ matrix.rust_target }}
96133

97134
- name: Publish to Github Releases
98135
env:
99136
GH_TOKEN: ${{ secrets.GH_TOKEN }}
100137
# TODO resolving to blank
101138
PKG_VER: ${{ needs.github_release_create.outputs.pkg_ver }}
102139
run: |
103-
gh release upload \
104-
$PKG_VER \
105-
target/${{ matrix.rust_target }}/release/http_status_code_check-${{ matrix.rust_target }}
140+
gh release upload $PKG_VER \
141+
http_status_code_check-${{ matrix.rust_target }}

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ homepage = "https://github.com/rmoraes92/http_status_code_check"
1010

1111
[dependencies]
1212
clap = { version = "4.5.27", features = ["derive"] }
13-
reqwest = { version = "0.12.12", features = ["blocking"] }
13+
reqwest = { version = "0.12.12", features = ["blocking", "native-tls-vendored"] }
1414

1515
[dev-dependencies]
1616
httpmock = "0.7.0"

0 commit comments

Comments
 (0)