Repository navigation
143 lines (123 loc) · 4.44 KB
/
Copy pathcipher-cli-release.yml
File metadata and controls
143 lines (123 loc) · 4.44 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
142
143
name: Cipher CLI — Release Builds
on:
push:
tags: ['v*']
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- target: aarch64-apple-darwin
os: macos-15
artifact: cipher-cli-macos-arm64
ext: ""
- target: x86_64-apple-darwin
os: macos-15
artifact: cipher-cli-macos-x64
ext: ""
- target: x86_64-unknown-linux-gnu
os: ubuntu-24.04
artifact: cipher-cli-linux-x64
ext: ""
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04
artifact: cipher-cli-linux-arm64
ext: ""
cross: true
- target: x86_64-pc-windows-msvc
os: windows-latest
artifact: cipher-cli-windows-x64
ext: ".exe"
steps:
- uses: actions/checkout@v4
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross (for cross-compilation)
if: ${{ matrix.cross }}
run: cargo install cross --locked
- name: Cache Cargo
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Build (native)
if: ${{ !matrix.cross }}
run: cargo build --release --target ${{ matrix.target }}
- name: Build (cross)
if: ${{ matrix.cross }}
run: cross build --release --target ${{ matrix.target }}
- name: Package binary
shell: bash
run: |
mkdir -p dist
BIN="target/${{ matrix.target }}/release/cipher-cli${{ matrix.ext }}"
cp "$BIN" "dist/${{ matrix.artifact }}${{ matrix.ext }}"
cd dist
if [[ "${{ matrix.ext }}" == ".exe" ]]; then
7z a "${{ matrix.artifact }}.zip" "${{ matrix.artifact }}${{ matrix.ext }}"
else
chmod +x "${{ matrix.artifact }}${{ matrix.ext }}"
tar czf "${{ matrix.artifact }}.tar.gz" "${{ matrix.artifact }}${{ matrix.ext }}"
fi
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.artifact }}.*
release:
name: Create Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Generate checksums
run: |
cd artifacts
find . -type f \( -name "*.tar.gz" -o -name "*.zip" \) -exec sha256sum {} \; | sort > SHA256SUMS.txt
cat SHA256SUMS.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
name: Cipher CLI ${{ github.ref_name }}
body: |
## ⚔️ Cipher CLI ${{ github.ref_name }}
Encrypted messaging from the terminal, powered by TKS Blockchain.
### Downloads
| Platform | Architecture | File |
|----------|-------------|------|
| **macOS** | Apple Silicon (M1/M2/M3) | `cipher-cli-macos-arm64.tar.gz` |
| **macOS** | Intel x64 | `cipher-cli-macos-x64.tar.gz` |
| **Linux** | x86_64 | `cipher-cli-linux-x64.tar.gz` |
| **Linux** | ARM64 | `cipher-cli-linux-arm64.tar.gz` |
| **Windows** | x86_64 | `cipher-cli-windows-x64.zip` |
### Quick Install
```bash
# macOS Apple Silicon
curl -sSfL https://github.com/TokenKickstarter/Cipher-cli/releases/download/${{ github.ref_name }}/cipher-cli-macos-arm64.tar.gz | tar xz
sudo mv cipher-cli-macos-arm64 /usr/local/bin/cipher-cli
# Linux x64
curl -sSfL https://github.com/TokenKickstarter/Cipher-cli/releases/download/${{ github.ref_name }}/cipher-cli-linux-x64.tar.gz | tar xz
sudo mv cipher-cli-linux-x64 /usr/local/bin/cipher-cli
```
files: |
artifacts/**/*.tar.gz
artifacts/**/*.zip
artifacts/**/SHA256SUMS.txt
generate_release_notes: true