Skip to content

Commit

Permalink
ci: include LICENSE files in artifact zips/deb
Browse files Browse the repository at this point in the history
Also check for their presence in the artifact testing stage.
  • Loading branch information
cpu committed Feb 5, 2025
1 parent 0743cb1 commit 306db98
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
22 changes: 21 additions & 1 deletion .github/workflows/artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
- name: Build rusts-ffi
run: |
cargo cinstall --locked --target x86_64-pc-windows-msvc --features cert_compression --release --prefix dist
cargo cinstall --locked --target x86_64-pc-windows-msvc --features cert_compression --release --prefix dist
- name: Copy in LICENSE files
run: cp LICENSE* dist

- name: Upload binaries
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -64,6 +67,9 @@ jobs:
run: |
cargo cinstall --locked --target x86_64-unknown-linux-gnu --features cert_compression --release --prefix dist
- name: Copy in LICENSE files
run: cp LICENSE* dist

- name: Upload binaries
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -127,6 +133,9 @@ jobs:
run: |
install_name_tool -id @rpath/librustls.dylib arm64-dist/lib/librustls.dylib
- name: Copy in LICENSE files (arm64)
run: cp LICENSE* arm64-dist

- name: Upload binaries (arm64)
uses: actions/upload-artifact@v4
with:
Expand All @@ -141,6 +150,9 @@ jobs:
run: |
install_name_tool -id @rpath/librustls.dylib x86-dist/lib/librustls.dylib
- name: Copy in LICENSE files (x86_64)
run: cp LICENSE* x86-dist

- name: Upload binaries (x86_64)
uses: actions/upload-artifact@v4
with:
Expand Down Expand Up @@ -172,6 +184,12 @@ jobs:
with:
name: ${{ matrix.artifact }}
path: ${{ matrix.artifact }}
- name: Verify license files are present
run: |
test -f ${{ matrix.artifact }}/LICENSE
test -f ${{ matrix.artifact }}/LICENSE-APACHE
test -f ${{ matrix.artifact }}/LICENSE-ISC
test -f ${{ matrix.artifact }}/LICENSE-MIT
# .pc files aren't relocatable. We need to update the prefix to point to
# the correct location that we extracted the archive. This seems more reliable
# than using `--define-prefix` - it seems to tack an extra 'lib/' subcomponent
Expand Down Expand Up @@ -251,6 +269,8 @@ jobs:
name: librustls_0.15.0_amd64.deb
- name: Install deb
run: sudo dpkg --install ./librustls_0.15.0_amd64.deb
- name: Check copyright exists
run: test -f /usr/share/doc/librustls/COPYRIGHT
# Dump out what pkg-config says about the rustls package.
- name: Debug pkg-config
run: |
Expand Down
3 changes: 2 additions & 1 deletion debian/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ DEB_ROOT="/tmp/deb"

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

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

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

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

Expand Down

0 comments on commit 306db98

Please sign in to comment.