Skip to content

Commit 306db98

Browse files
committed
ci: include LICENSE files in artifact zips/deb
Also check for their presence in the artifact testing stage.
1 parent 0743cb1 commit 306db98

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

.github/workflows/artifacts.yaml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ jobs:
2929
3030
- name: Build rusts-ffi
3131
run: |
32-
cargo cinstall --locked --target x86_64-pc-windows-msvc --features cert_compression --release --prefix dist
32+
cargo cinstall --locked --target x86_64-pc-windows-msvc --features cert_compression --release --prefix dist
33+
34+
- name: Copy in LICENSE files
35+
run: cp LICENSE* dist
3336

3437
- name: Upload binaries
3538
uses: actions/upload-artifact@v4
@@ -64,6 +67,9 @@ jobs:
6467
run: |
6568
cargo cinstall --locked --target x86_64-unknown-linux-gnu --features cert_compression --release --prefix dist
6669
70+
- name: Copy in LICENSE files
71+
run: cp LICENSE* dist
72+
6773
- name: Upload binaries
6874
uses: actions/upload-artifact@v4
6975
with:
@@ -127,6 +133,9 @@ jobs:
127133
run: |
128134
install_name_tool -id @rpath/librustls.dylib arm64-dist/lib/librustls.dylib
129135
136+
- name: Copy in LICENSE files (arm64)
137+
run: cp LICENSE* arm64-dist
138+
130139
- name: Upload binaries (arm64)
131140
uses: actions/upload-artifact@v4
132141
with:
@@ -141,6 +150,9 @@ jobs:
141150
run: |
142151
install_name_tool -id @rpath/librustls.dylib x86-dist/lib/librustls.dylib
143152
153+
- name: Copy in LICENSE files (x86_64)
154+
run: cp LICENSE* x86-dist
155+
144156
- name: Upload binaries (x86_64)
145157
uses: actions/upload-artifact@v4
146158
with:
@@ -172,6 +184,12 @@ jobs:
172184
with:
173185
name: ${{ matrix.artifact }}
174186
path: ${{ matrix.artifact }}
187+
- name: Verify license files are present
188+
run: |
189+
test -f ${{ matrix.artifact }}/LICENSE
190+
test -f ${{ matrix.artifact }}/LICENSE-APACHE
191+
test -f ${{ matrix.artifact }}/LICENSE-ISC
192+
test -f ${{ matrix.artifact }}/LICENSE-MIT
175193
# .pc files aren't relocatable. We need to update the prefix to point to
176194
# the correct location that we extracted the archive. This seems more reliable
177195
# than using `--define-prefix` - it seems to tack an extra 'lib/' subcomponent
@@ -251,6 +269,8 @@ jobs:
251269
name: librustls_0.15.0_amd64.deb
252270
- name: Install deb
253271
run: sudo dpkg --install ./librustls_0.15.0_amd64.deb
272+
- name: Check copyright exists
273+
run: test -f /usr/share/doc/librustls/COPYRIGHT
254274
# Dump out what pkg-config says about the rustls package.
255275
- name: Debug pkg-config
256276
run: |

debian/build.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ DEB_ROOT="/tmp/deb"
1717

1818
CC=clang CXX=clang cargo cinstall --locked --features cert_compression --release --prefix "${DIST_DIR}"
1919

20-
mkdir -p "${DEB_ROOT}/usr/"{lib,include}
20+
mkdir -p "${DEB_ROOT}/usr/"{lib,include,share/doc/${PACKAGE}}
2121
mkdir -p "${DEB_ROOT}/DEBIAN"
2222

2323
cp -r "${DIST_DIR}/lib/"* "${DEB_ROOT}/usr/lib/"
2424
cp -r "${DIST_DIR}/include/"* "${DEB_ROOT}/usr/include/"
25+
cat ../LICENSE* > "${DEB_ROOT}/usr/share/doc/${PACKAGE}/COPYRIGHT"
2526

2627
sed -i "s|prefix=.*|prefix=/usr|" "${DEB_ROOT}/usr/lib/x86_64-linux-gnu/pkgconfig/rustls.pc"
2728

0 commit comments

Comments
 (0)