Skip to content

Commit 048e24f

Browse files
committed
Add CI, musl builds for release
* Add CHANGELOG * force strip/lto for release build * move to rustls-tls
1 parent 37c9684 commit 048e24f

File tree

9 files changed

+228
-176
lines changed

9 files changed

+228
-176
lines changed

.cargo/config

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[build]
2+
rustflags = ["-C", "target-feature=+crt-static"]
3+
target = "x86_64-unknown-linux-musl"

.github/workflows/binaries.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
on:
2+
push:
3+
branches: [ master ]
4+
tags: [ 'v*' ]
5+
pull_request:
6+
branches: [ master ]
7+
8+
name: binaries
9+
10+
jobs:
11+
# release binaries
12+
release-bins:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
targets:
17+
- x86_64-unknown-linux-musl
18+
bins:
19+
- zerus
20+
- zerus-serve
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@stable
25+
with:
26+
target: ${{ matrix.targets }}
27+
- run: cargo install cross || true
28+
- run: cross build --bin ${{ matrix.bins }} --locked --release --target ${{ matrix.targets }}
29+
30+
- name: archive
31+
run: |
32+
tar -czvf ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz \
33+
-C target/${{ matrix.targets }}/release/ ${{ matrix.bins }}
34+
35+
- uses: actions/upload-artifact@v2
36+
with:
37+
name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
38+
path: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
39+
40+
- name: Upload binary to release
41+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
42+
uses: svenstaro/upload-release-action@v2
43+
with:
44+
repo_token: ${{ secrets.GITHUB_TOKEN }}
45+
file: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
46+
asset_name: ${{ matrix.bins }}-${{ matrix.targets }}.tar.gz
47+
tag: ${{ github.ref }}
48+
overwrite: true

.github/workflows/main.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
on:
2+
push:
3+
branches:
4+
- master
5+
pull_request:
6+
branches:
7+
- master
8+
9+
name: ci
10+
11+
jobs:
12+
# build, test all supported targets
13+
build-test-stable:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
targets:
18+
- x86_64-unknown-linux-musl
19+
toolchain:
20+
- stable
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: dtolnay/rust-toolchain@master
25+
with:
26+
toolchain: ${{ matrix.toolchain }}
27+
target: ${{ matrix.targets }}
28+
- run: cargo install cross || true
29+
- run: cross build --locked --workspace --target ${{ matrix.targets }}
30+
31+
# fmt and clippy on nightly builds
32+
fmt-clippy-nightly:
33+
runs-on: ubuntu-latest
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
- uses: dtolnay/rust-toolchain@master
38+
with:
39+
toolchain: nightly
40+
target: x86_64-unknown-linux-musl
41+
components: rustfmt, clippy
42+
- run: cargo install cross || true
43+
- run: cargo fmt --all --check
44+
- run: cross clippy --target x86_64-unknown-linux-gnu --workspace -- -D warnings

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Changelog
2+
All notable changes to this project will be documented in this file.
3+
4+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6+
7+
## [Unreleased]
8+
9+
## [0.1.0] - 07-27-2022
10+
- Initial Release

0 commit comments

Comments
 (0)