Skip to content

Commit 190f0da

Browse files
authored
Fix broken CI (#44)
* Install musl-compatible OpenSSL for x86_64-unknown-linux-musl in CD workflow * Simplify OpenSSL setup in CD workflow and use vendored feature * Add async function to read input and flush stdout in hook.rs 🤖 * Add main branch check to CD workflow job steps * Remove redundant progress bar callbacks in hook.rs 🤖 * Add Linux target dependency installation to CD workflow * Add dry run test for crates.io publish in CD workflow * Replace symlink creation with file copy in install script 🤖 * Remove redundant 'if' conditions from cd.yml workflow * Uncomment additional CD workflow targets * Update cd.yml
1 parent 198f478 commit 190f0da

File tree

3 files changed

+116
-85
lines changed

3 files changed

+116
-85
lines changed

.github/workflows/cd.yml

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,9 @@ jobs:
4040
- uses: actions/checkout@v4
4141

4242
- name: Setup Rust
43-
uses: actions-rs/toolchain@v1
43+
uses: dtolnay/rust-toolchain@nightly
4444
with:
45-
toolchain: nightly
46-
target: ${{ matrix.target }}
47-
override: true
48-
profile: minimal
45+
targets: ${{ matrix.target }}
4946

5047
- name: Add x86_64-unknown-linux-musl target
5148
if: matrix.target == 'x86_64-unknown-linux-musl'
@@ -55,6 +52,15 @@ jobs:
5552
5653
- name: Install Dependencies for musl Target
5754
if: matrix.target == 'x86_64-unknown-linux-musl'
55+
run: |
56+
sudo apt-get update
57+
sudo apt-get install -y musl-tools musl-dev perl make pkg-config libssl-dev
58+
# Set up environment for musl compilation
59+
echo "CC_x86_64_unknown_linux_musl=musl-gcc" >> $GITHUB_ENV
60+
echo "CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER=musl-gcc" >> $GITHUB_ENV
61+
62+
- name: Install Dependencies for Linux Target
63+
if: matrix.target == 'x86_64-unknown-linux-gnu'
5864
run: |
5965
sudo apt-get update
6066
sudo apt-get install -y pkg-config libssl-dev
@@ -81,11 +87,7 @@ jobs:
8187
- uses: actions/checkout@v4
8288

8389
- name: Setup Rust
84-
uses: actions-rs/toolchain@v1
85-
with:
86-
toolchain: nightly
87-
override: true
88-
profile: minimal
90+
uses: dtolnay/rust-toolchain@nightly
8991

9092
- name: Configure git user name
9193
run: git config user.name ${{ github.actor }}
@@ -113,11 +115,21 @@ jobs:
113115
run: git tag v${{ steps.app.outputs.version }}
114116

115117
- name: Publish to crates.io
118+
if: github.ref == 'refs/heads/main'
116119
run: cargo publish --allow-dirty
117120

121+
- name: Test publish to crates.io (dry run)
122+
if: github.ref != 'refs/heads/main'
123+
run: cargo publish --dry-run --allow-dirty
124+
118125
- name: Push to origin
126+
if: github.ref == 'refs/heads/main'
119127
run: git push origin HEAD --tags
120128

129+
- name: Test push to origin (dry run)
130+
if: github.ref != 'refs/heads/main'
131+
run: git push origin HEAD --tags --dry-run
132+
121133
- name: Download all artifacts
122134
run: gh run download ${{ github.run_id }}
123135

@@ -128,6 +140,7 @@ jobs:
128140
done
129141
130142
- name: Uploads compressed artifacts
143+
if: github.ref == 'refs/heads/main'
131144
uses: softprops/action-gh-release@v2
132145
with:
133146
tag_name: v${{ steps.app.outputs.version }}

0 commit comments

Comments
 (0)