Skip to content

Commit 314ad8f

Browse files
fix CI issues(#125)
switch to rustls, etc.
1 parent bf9bc07 commit 314ad8f

File tree

6 files changed

+139
-198
lines changed

6 files changed

+139
-198
lines changed

.github/workflows/ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,3 +83,40 @@ jobs:
8383

8484
- name: Run cargo deny
8585
run: cargo deny check advisories licenses sources
86+
87+
build:
88+
name: Build ${{ matrix.target }}
89+
runs-on: ${{ matrix.os }}
90+
strategy:
91+
matrix:
92+
include:
93+
- os: ubuntu-latest
94+
target: x86_64-unknown-linux-musl
95+
- os: macos-latest
96+
target: x86_64-apple-darwin
97+
- os: macos-latest
98+
target: aarch64-apple-darwin
99+
- os: windows-latest
100+
target: x86_64-pc-windows-msvc
101+
102+
steps:
103+
- uses: actions/checkout@v4
104+
105+
- name: Install Rust
106+
uses: dtolnay/rust-toolchain@stable
107+
with:
108+
targets: ${{ matrix.target }}
109+
110+
- name: Install dependencies (Linux)
111+
if: matrix.target == 'x86_64-unknown-linux-musl'
112+
run: |
113+
sudo apt-get update
114+
sudo apt-get install -y musl-tools
115+
116+
- name: Cache dependencies
117+
uses: Swatinem/rust-cache@v2
118+
with:
119+
key: ${{ matrix.target }}
120+
121+
- name: Build
122+
run: cargo build --release --target ${{ matrix.target }}

.github/workflows/release.yml

Lines changed: 38 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Release
33
on:
44
push:
55
tags:
6-
- 'v*'
6+
- "v*"
77

88
permissions:
99
contents: write
@@ -14,21 +14,21 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- uses: actions/checkout@v4
17-
17+
1818
- name: Extract version from tag
1919
id: tag_version
2020
run: |
2121
TAG="${GITHUB_REF#refs/tags/v}"
2222
echo "version=$TAG" >> $GITHUB_OUTPUT
2323
echo "Tag version: $TAG"
24-
24+
2525
- name: Extract version from Cargo.toml
2626
id: cargo_version
2727
run: |
2828
CARGO_VERSION=$(grep '^version = ' Cargo.toml | head -1 | cut -d'"' -f2)
2929
echo "version=$CARGO_VERSION" >> $GITHUB_OUTPUT
3030
echo "Cargo.toml version: $CARGO_VERSION"
31-
31+
3232
- name: Validate versions match
3333
run: |
3434
if [ "${{ steps.tag_version.outputs.version }}" != "${{ steps.cargo_version.outputs.version }}" ]; then
@@ -37,9 +37,27 @@ jobs:
3737
fi
3838
echo "Version validation passed: ${{ steps.tag_version.outputs.version }}"
3939
40+
test:
41+
name: Run tests before release
42+
needs: validate
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v4
46+
47+
- name: Install Rust
48+
uses: dtolnay/rust-toolchain@stable
49+
50+
- name: Run tests
51+
run: cargo test --all-features
52+
53+
- name: Run clippy
54+
run: |
55+
rustup component add clippy
56+
cargo clippy --all-features -- -D warnings
57+
4058
build:
4159
name: Build ${{ matrix.target }}
42-
needs: validate
60+
needs: test
4361
runs-on: ${{ matrix.os }}
4462
strategy:
4563
matrix:
@@ -56,37 +74,37 @@ jobs:
5674
- os: windows-latest
5775
target: x86_64-pc-windows-msvc
5876
archive_name: cage-${{ github.ref_name }}-windows-x86_64.zip
59-
77+
6078
steps:
6179
- uses: actions/checkout@v4
62-
80+
6381
- name: Install Rust
6482
uses: dtolnay/rust-toolchain@stable
6583
with:
6684
targets: ${{ matrix.target }}
67-
68-
- name: Install musl tools (Linux)
85+
86+
- name: Install dependencies (Linux)
6987
if: matrix.target == 'x86_64-unknown-linux-musl'
7088
run: |
7189
sudo apt-get update
7290
sudo apt-get install -y musl-tools
73-
91+
7492
- name: Build
7593
run: cargo build --release --target ${{ matrix.target }}
76-
94+
7795
- name: Create archive (Unix)
7896
if: runner.os != 'Windows'
7997
run: |
8098
cd target/${{ matrix.target }}/release
8199
zip ../../../${{ matrix.archive_name }} cage
82-
100+
83101
- name: Create archive (Windows)
84102
if: runner.os == 'Windows'
85103
shell: pwsh
86104
run: |
87105
cd target/${{ matrix.target }}/release
88106
Compress-Archive -Path cage.exe -DestinationPath ../../../${{ matrix.archive_name }}
89-
107+
90108
- name: Upload artifact
91109
uses: actions/upload-artifact@v4
92110
with:
@@ -99,35 +117,35 @@ jobs:
99117
runs-on: ubuntu-latest
100118
steps:
101119
- uses: actions/checkout@v4
102-
120+
103121
- name: Download all artifacts
104122
uses: actions/download-artifact@v4
105123
with:
106124
path: artifacts
107-
125+
108126
- name: Prepare release files
109127
run: |
110128
mkdir release-files
111129
find artifacts -name "*.zip" -exec cp {} release-files/ \;
112130
ls -lh release-files/
113-
131+
114132
- name: Extract changelog for this version
115133
id: changelog
116134
run: |
117135
VERSION="${GITHUB_REF#refs/tags/v}"
118136
echo "Extracting changelog for version $VERSION"
119-
137+
120138
# Extract the section between this version and the next one
121139
CHANGELOG=$(awk "/## $VERSION/,/## [0-9]/" CHANGELOG.md | sed '1d;$d')
122-
140+
123141
# If empty, use a default message
124142
if [ -z "$CHANGELOG" ]; then
125143
CHANGELOG="Release $VERSION"
126144
fi
127-
145+
128146
# Save to file for multi-line handling
129147
echo "$CHANGELOG" > changelog.txt
130-
148+
131149
- name: Create Release
132150
uses: softprops/action-gh-release@v2
133151
with:
@@ -137,4 +155,3 @@ jobs:
137155
prerelease: false
138156
env:
139157
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
140-

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
1212

1313
- Replaced `boondock` Docker client with `bollard` for better async/await support and active maintenance.
1414
- Updated `tokio` runtime from 0.2 to 1.x for better async compatibility.
15+
- Switched from openssl to rustls
1516

1617
## 0.3.6 - 2021-05-10
1718

0 commit comments

Comments
 (0)