1+ name : Release
2+
3+ on :
4+ push :
5+ tags : ["v*"]
6+
7+ permissions :
8+ contents : write
9+
10+ jobs :
11+ build :
12+ name : Build ${{ matrix.target }}
13+ runs-on : ${{ matrix.os }}
14+ strategy :
15+ matrix :
16+ include :
17+ - os : ubuntu-latest
18+ target : x86_64-unknown-linux-gnu
19+ archive : tar.gz
20+ - os : macos-latest
21+ target : x86_64-apple-darwin
22+ archive : tar.gz
23+ - os : macos-latest
24+ target : aarch64-apple-darwin
25+ archive : tar.gz
26+ - os : windows-latest
27+ target : x86_64-pc-windows-msvc
28+ archive : zip
29+
30+ steps :
31+ - uses : actions/checkout@v4
32+
33+ - name : Install Rust
34+ uses : dtolnay/rust-toolchain@stable
35+ with :
36+ targets : ${{ matrix.target }}
37+
38+ - name : Install dependencies (Linux)
39+ if : runner.os == 'Linux'
40+ run : sudo apt-get install -y libsqlcipher-dev
41+
42+ - name : Install dependencies (macOS)
43+ if : runner.os == 'macOS'
44+ run : brew install sqlcipher
45+
46+ - name : Build release
47+ run : cargo build --release --target ${{ matrix.target }}
48+
49+ - name : Package (Unix)
50+ if : runner.os != 'Windows'
51+ run : |
52+ cd target/${{ matrix.target }}/release
53+ tar czf ../../../dotkeep-${{ matrix.target }}.tar.gz dotkeep
54+ cd ../../..
55+
56+ - name : Package (Windows)
57+ if : runner.os == 'Windows'
58+ run : |
59+ cd target/${{ matrix.target }}/release
60+ Compress-Archive dotkeep.exe ../../../dotkeep-${{ matrix.target }}.zip
61+ cd ../../..
62+
63+ - name : Upload artifact
64+ uses : actions/upload-artifact@v4
65+ with :
66+ name : dotkeep-${{ matrix.target }}
67+ path : dotkeep-${{ matrix.target }}.*
68+
69+ release :
70+ name : Create Release
71+ needs : build
72+ runs-on : ubuntu-latest
73+ steps :
74+ - uses : actions/checkout@v4
75+
76+ - name : Download all artifacts
77+ uses : actions/download-artifact@v4
78+ with :
79+ path : artifacts
80+
81+ - name : Create GitHub Release
82+ uses : softprops/action-gh-release@v1
83+ with :
84+ files : artifacts/**/*
85+ generate_release_notes : true
86+ env :
87+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
0 commit comments