-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (66 loc) · 2.26 KB
/
build.yaml
File metadata and controls
76 lines (66 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
on: # yamllint disable-line rule:truthy
push:
tags:
- "v*.*.*"
jobs:
build:
name: Build
runs-on: ubuntu-20.04
env:
RUST_BACKTRACE: full
RUSTC_WRAPPER: sccache
SCCACHE_VERSION: v0.3.3
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
# SCCACHE_RECACHE: 1 # Uncomment this to clear cache, then comment it back out
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
- name: Install sccache
run: |
mkdir -p $HOME/.local/bin
echo "$HOME/.local/bin" >> $GITHUB_PATH
curl -L "$BASE_URL/$SCCACHE_VERSION/$FILE.tar.gz" | tar xz
mv -f $FILE/sccache $HOME/.local/bin/sccache
env:
BASE_URL: https://github.com/mozilla/sccache/releases/download
FILE: sccache-${{ env.SCCACHE_VERSION }}-x86_64-unknown-linux-musl
- name: Cache Cargo Registry
uses: actions/cache@v3
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: build-${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
build-${{ runner.os }}-cargo-
- name: Cache sccache
uses: actions/cache@v3
with:
path: ${{ env.SCCACHE_DIR }}
key: build-${{ runner.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-sccache-
build-${{ runner.os }}-sccache-
- name: Start sccache
run: sccache --start-server
- run: cargo install cargo-deb
- run: cargo build --release
- run: cargo deb
- name: Get package version
run: |
version=$(./target/release/external-postgres -V | awk '{ print $2 }')
mv ./target/release/external-postgres ./target/release/external-postgres-$version-linux-amd64
- uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
files: |
target/release/external-postgres-*
target/debian/*.deb
- name: Show sccache stats
run: sccache --show-stats
- name: Stop sccache
run: sccache --stop-server || true