-
Notifications
You must be signed in to change notification settings - Fork 0
141 lines (119 loc) · 4.07 KB
/
Copy pathrelease.yml
File metadata and controls
141 lines (119 loc) · 4.07 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Release
on:
push:
tags:
- "v*"
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/devcontainers/rust:1-bullseye
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Nix with Cachix
uses: cachix/install-nix-action@v30
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Setup FlakeHub Cache
uses: DeterminateSystems/flakehub-cache-action@v7
with:
cache-name: "singularity-analysis"
visibility: "public"
env:
FLAKEHUB_PUSH_TOKEN: ${{ secrets.FLAKEHUB_PUSH_TOKEN }}
- name: Setup Cachix
uses: cachix/cachix-action@v15
with:
name: mikkihugo
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: Cache cargo registry
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
key: cargo-release-registry-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo target
uses: actions/cache@v4
with:
path: target
key: cargo-release-target-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
- name: Clippy (strictest settings for release)
run: |
cargo clippy --workspace --all-targets --all-features -- \
-D warnings \
-D clippy::all \
-D clippy::pedantic \
-D clippy::nursery \
-D clippy::cargo \
-W clippy::restriction \
-A clippy::missing_docs_in_private_items \
-A clippy::implicit_return \
-A clippy::missing_inline_in_public_items \
-A clippy::question_mark_used \
-A clippy::mod_module_files \
-A clippy::self_named_module_files
- name: Run tests
run: cargo test --workspace --all-targets
- name: Build release library
run: cargo build --workspace --release --lib
- name: Build CLI binary
run: cargo build --release --bin singularity-rca --features cli
- name: Prepare artifact directory
run: mkdir -p release-artifacts
- name: Generate release review
run: ./scripts/generate-release-review.sh release-artifacts/RELEASE_REVIEW.md
env:
GITHUB_REF_NAME: ${{ github.ref_name }}
- name: Package CLI binary
run: |
if [ -f target/release/singularity-rca ]; then
cp target/release/singularity-rca release-artifacts/
chmod +x release-artifacts/singularity-rca
echo "✓ CLI binary packaged"
fi
- name: Package library artifacts
run: |
find target/release -maxdepth 1 -type f -executable -exec cp {} release-artifacts/ \;
find target/release -maxdepth 1 -name "*.so" -exec cp {} release-artifacts/ \;
- name: Create source tarball
run: |
tar -czf release-artifacts/singularity-rca-source.tar.gz \
--exclude=target \
--exclude=.git \
--exclude=_build \
--exclude=deps \
--exclude=.direnv \
.
- name: Create binary tarball
run: |
tar -czf release-artifacts/singularity-rca-binaries.tar.gz -C release-artifacts singularity-rca
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: singularity-analysis-artifacts
path: release-artifacts
publish:
runs-on: ubuntu-latest
needs: build
container:
image: mcr.microsoft.com/devcontainers/rust:1-bullseye
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: singularity-analysis-artifacts
path: dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: dist/**
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}