Skip to content

Commit 541abac

Browse files
committed
tmp: build golden packages
1 parent 8b45ed5 commit 541abac

File tree

2 files changed

+50
-169
lines changed

2 files changed

+50
-169
lines changed

.github/workflows/libssl.yaml

Lines changed: 47 additions & 167 deletions
Original file line numberDiff line numberDiff line change
@@ -15,188 +15,68 @@ defaults:
1515
working-directory: rustls-libssl
1616

1717
jobs:
18-
build:
19-
name: Build+test
20-
runs-on: ${{ matrix.os }}
18+
release_packages:
19+
name: Produce release packages
20+
runs-on: ubuntu-latest
21+
container: ${{ matrix.container }}:${{ matrix.version }}
2122
strategy:
2223
matrix:
23-
rust:
24-
- stable
25-
- beta
26-
- nightly
27-
# TODO(XXX): consider replacing ubuntu-24.04 w/ ubuntu-latest when appropriate
28-
os: [ubuntu-24.04, ubuntu-22.04]
29-
steps:
30-
- name: Checkout sources
31-
uses: actions/checkout@v4
32-
with:
33-
persist-credentials: false
34-
35-
- name: Install build dependencies
36-
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
24+
include:
25+
- container: fedora
26+
version: 40
27+
package: rpm
28+
# - container: ubuntu
29+
# version: 24.04
30+
# package: deb
31+
# - container: ubuntu
32+
# version: 22.04
33+
# package: deb
3734

38-
- name: Install ${{ matrix.rust }} toolchain
39-
uses: dtolnay/rust-toolchain@master
40-
with:
41-
toolchain: ${{ matrix.rust }}
42-
43-
- run: make PROFILE=debug test
44-
- run: make PROFILE=debug integration
45-
# Note: we only check the client/server binaries here, assuming that
46-
# is sufficient for any other test binaries.
47-
- name: Verify debug builds were using ASAN
48-
run: |
49-
nm target/client | grep '__asan_init'
50-
nm target/server | grep '__asan_init'
51-
- name: Build release binaries
52-
run: |
53-
make clean
54-
make PROFILE=release
55-
- name: Verify release builds were not using ASAN
56-
run: |
57-
nm target/client | grep -v '__asan_init'
58-
nm target/server | grep -v '__asan_init'
59-
60-
valgrind:
61-
name: Valgrind
62-
runs-on: ubuntu-latest
6335
steps:
64-
- uses: actions/checkout@v4
65-
with:
66-
persist-credentials: false
67-
- name: Install rust toolchain
68-
uses: dtolnay/rust-toolchain@stable
69-
- name: Install valgrind
70-
run: sudo apt-get update && sudo apt-get install -y valgrind
71-
- name: Install build dependencies
72-
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
73-
- run: VALGRIND="valgrind -q" make PROFILE=release test integration
74-
75-
docs:
76-
name: Check for documentation errors
77-
runs-on: ubuntu-latest
78-
steps:
79-
- name: Checkout sources
80-
uses: actions/checkout@v4
81-
with:
82-
persist-credentials: false
83-
84-
- name: Install build dependencies
85-
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
86-
87-
- name: Install rust toolchain
88-
uses: dtolnay/rust-toolchain@nightly
36+
- name: Install prerequisites (debian-like)
37+
if: matrix.package == 'deb'
38+
working-directory: /
39+
run: |
40+
apt-get update
41+
apt-get install -y curl build-essential git
8942
90-
- name: cargo doc (all features)
91-
run: cargo doc --all-features --no-deps --workspace
92-
env:
93-
RUSTDOCFLAGS: -Dwarnings
43+
- name: Install prerequisites (fedora-like)
44+
if: matrix.package == 'rpm'
45+
working-directory: /
46+
run: |
47+
yum install -y curl make automake gcc gcc-c++ kernel-devel
9448
95-
format:
96-
name: Format
97-
runs-on: ubuntu-latest
98-
steps:
9949
- name: Checkout sources
10050
uses: actions/checkout@v4
10151
with:
10252
persist-credentials: false
103-
- name: Install rust toolchain
104-
uses: dtolnay/rust-toolchain@stable
105-
with:
106-
components: rustfmt
107-
- name: Check Rust formatting
108-
run: cargo fmt --all -- --check
109-
- name: Check src/entry.rs formatting
110-
run: ./admin/format --all -- --check
111-
- name: Check C formatting
112-
run: make format-check
113-
- name: Check ordering of build.rs entrypoints
114-
run: ./admin/sort-entrypoints.py
115-
- name: Check MATRIX.md is up-to-date
116-
run: ./admin/matrix.py > MATRIX.md.new && diff -su MATRIX.md MATRIX.md.new
11753

118-
clippy:
119-
name: Clippy
120-
runs-on: ubuntu-latest
121-
steps:
122-
- name: Checkout sources
123-
uses: actions/checkout@v4
124-
with:
125-
persist-credentials: false
126-
- name: Install rust toolchain
54+
- name: Install stable rust toolchain
12755
uses: dtolnay/rust-toolchain@stable
128-
with:
129-
components: clippy
130-
- name: Check clippy
131-
# We allow unknown lints here because sometimes the nightly job
132-
# (below) will have a new lint that we want to suppress.
133-
# If we suppress (e.g. #![allow(clippy::arc_with_non_send_sync)]),
134-
# we would get an unknown-lint error from older clippy versions.
135-
run: cargo clippy --locked --workspace --all-targets -- -D warnings -A unknown-lints
136-
137-
clippy-nightly-optional:
138-
name: Clippy nightly (optional)
139-
runs-on: ubuntu-latest
140-
steps:
141-
- name: Checkout sources
142-
uses: actions/checkout@v4
143-
with:
144-
persist-credentials: false
145-
- name: Install rust toolchain
146-
uses: dtolnay/rust-toolchain@nightly
147-
with:
148-
components: clippy
149-
- name: Check clippy
150-
run: cargo clippy --locked --workspace --all-targets -- -D warnings
15156

152-
clang-tidy:
153-
name: Clang Tidy
154-
runs-on: ubuntu-latest
155-
steps:
156-
- name: Checkout sources
157-
uses: actions/checkout@v4
158-
with:
159-
persist-credentials: false
160-
- name: Clang tidy
161-
run: clang-tidy tests/*.c -- -I src/
162-
163-
miri:
164-
name: Miri
165-
runs-on: ubuntu-latest
166-
steps:
167-
- name: Checkout sources
168-
uses: actions/checkout@v4
169-
with:
170-
persist-credentials: false
171-
172-
- name: Install nightly Rust
173-
uses: dtolnay/rust-toolchain@nightly
174-
- run: rustup override set "nightly-$(curl -s https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/miri)"
175-
- run: rustup component add miri
176-
- run: cargo miri test
177-
178-
packaging:
179-
name: Packaging
180-
runs-on: ubuntu-latest
181-
steps:
182-
- name: Checkout sources
183-
uses: actions/checkout@v4
184-
with:
185-
persist-credentials: false
186-
187-
- name: Install build dependencies
188-
run: sudo apt-get update && sudo apt-get install -y openssl libssl3 libssl-dev lld
189-
190-
- name: Install cargo-get
191-
run: cargo install cargo-get
57+
- name: Install build dependencies (debian-like)
58+
if: matrix.package == 'deb'
59+
run: |
60+
apt-get update
61+
apt-get install -y openssl libssl3 libssl-dev lld golang-go
62+
cargo install cargo-get
63+
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
19264
193-
- name: Install nfpm
65+
- name: Install build dependencies (fedora-like)
66+
if: matrix.package == 'rpm'
19467
run: |
68+
apt-get update
69+
apt-get install -y openssl openssl-devel lld go
70+
cargo install cargo-get
19571
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
196-
echo PATH=$PATH:$HOME/go/bin >> $GITHUB_ENV
19772
198-
- name: Build packages
199-
run: make package PROFILE=release
73+
- name: Build package
74+
run: |
75+
make package-${{ matrix.package }} PROFILE=release NFPM=$HOME/go/bin/nfpm
20076
201-
- name: Test packages
202-
run: make test-package PROFILE=release
77+
- name: Archive package
78+
uses: actions/upload-artifact@v4
79+
with:
80+
name: ${{ matrix.package }} package built on ${{ matrix.container }} ${{ matrix.version }}
81+
path: rustls-libssl/target/dist/*.${{ matrix.package }}
82+
if-no-files-found: error

rustls-libssl/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
CARGO ?= cargo
2+
NFPM ?= nfpm
23
CARGOFLAGS += --locked
34

45
CFLAGS := -Werror -Wall -Wextra -Wpedantic -g $(shell pkg-config --cflags openssl)
@@ -73,13 +74,13 @@ package-deb: dist/nfpm.yaml target/release/libssl.so.3 target/VERSION
7374
mkdir --parents target/dist
7475
env VERSION=$(shell $(CARGO) get package.version) \
7576
VERSION_PRERELEASE=$(shell $(CARGO) get package.version --pre) \
76-
nfpm package --config $< --target target/dist --packager deb
77+
$(NFPM) package --config $< --target target/dist --packager deb
7778

7879
package-rpm: dist/nfpm.yaml target/release/libssl.so.3 target/VERSION
7980
mkdir --parents target/dist
8081
env VERSION=$(shell $(CARGO) get package.version) \
8182
VERSION_PRERELEASE=$(shell $(CARGO) get package.version --pre) \
82-
nfpm package --config $< --target target/dist --packager rpm
83+
$(NFPM) package --config $< --target target/dist --packager rpm
8384

8485
target/VERSION: ALWAYS
8586
echo "This is rustls-libssl `git describe --always`\nDate: `date`\nIncorporating:" > $@

0 commit comments

Comments
 (0)