Skip to content

Commit fcbf260

Browse files
authored
workspace: initial release cycle files (#370)
* initial files * hashes * ci: more targets * release.yml * moves * remove commit list * typo * add linux arm to `monerod-download` * update * fast sync * remove `cuprated.service` * update * changes * move contributing
1 parent bd17f61 commit fcbf260

File tree

12 files changed

+214
-10
lines changed

12 files changed

+214
-10
lines changed

.github/actions/monerod-download/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ runs:
2929
steps:
3030
- name: Monero Daemon Cache
3131
id: cache-monerod
32-
uses: actions/cache@v3
32+
uses: actions/cache@v4
3333
with:
3434
path: |
3535
monerod
@@ -48,6 +48,7 @@ runs:
4848
"Windows X86") FILE=monero-win-x86-${{ inputs.version }}.zip ;;
4949
"Linux X64") FILE=monero-linux-x64-${{ inputs.version }}.tar.bz2 ;;
5050
"Linux X86") FILE=monero-linux-x86-${{ inputs.version }}.tar.bz2 ;;
51+
"Linux ARM64") FILE=monero-linux-armv8-${{ inputs.version }}.tar.bz2 ;;
5152
"macOS X64") FILE=monero-mac-x64-${{ inputs.version }}.tar.bz2 ;;
5253
"macOS ARM64") FILE=monero-mac-armv8-${{ inputs.version }}.tar.bz2 ;;
5354
*) exit 1 ;;

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,9 @@ jobs:
8787
os: [
8888
windows-2022, # EOL = 2026-10-13 | <https://endoflife.date/windows-server>
8989
macos-15, # EOL = 2027-09-16 | <https://endoflife.date/macos>
90-
ubuntu-22.04 # EOL = 2027-04-01 | <https://endoflife.date/ubuntu>
90+
macos-13, # EOL = 2025-10-24 | For x64.
91+
ubuntu-22.04, # EOL = 2027-04-01 | <https://endoflife.date/ubuntu>
92+
ubuntu-22.04-arm,
9193
]
9294

9395
steps:
@@ -133,4 +135,4 @@ jobs:
133135
- name: Hack Check
134136
run: |
135137
cargo install cargo-hack --locked
136-
cargo hack --workspace check --feature-powerset --no-dev-deps
138+
cargo hack --workspace check --feature-powerset --no-dev-deps

.github/workflows/release.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: Release Builds
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
commit:
7+
description: 'Commit to build'
8+
required: true
9+
type: string
10+
11+
env:
12+
# Show colored output in CI.
13+
CARGO_TERM_COLOR: always
14+
# The folder used to store release files - this will be uploaded.
15+
ARCHIVE: "__ARCHIVE"
16+
17+
jobs:
18+
build:
19+
strategy:
20+
matrix:
21+
os: [
22+
windows-2022, # EOL = 2026-10-13 | <https://endoflife.date/windows-server>
23+
macos-15, # EOL = 2027-09-16 | <https://endoflife.date/macos>
24+
macos-13, # EOL = 2025-10-24 | For x64.
25+
ubuntu-22.04, # EOL = 2027-04-01 | <https://endoflife.date/ubuntu>
26+
ubuntu-22.04-arm,
27+
]
28+
29+
runs-on: ${{ matrix.os }}
30+
31+
defaults:
32+
run:
33+
shell: bash
34+
35+
steps:
36+
- name: Checkout
37+
uses: actions/checkout@v4
38+
with:
39+
submodules: recursive
40+
ref: ${{ inputs.commit }}
41+
42+
- name: Install Rust
43+
uses: dtolnay/rust-toolchain@master
44+
with:
45+
toolchain: stable
46+
47+
- name: Build
48+
run: cargo build --release --package cuprated
49+
50+
- name: Generate Archives
51+
run: |
52+
set -e -o pipefail # Exit on failures
53+
umask 0022 # 755 permissions
54+
export TZ=UTC # UTC timezone
55+
56+
# Reset archive directory in-case.
57+
rm -rf ${{ env.ARCHIVE }}
58+
mkdir -p ${{ env.ARCHIVE }}
59+
ARCHIVE=$(realpath ${{ env.ARCHIVE }})
60+
VERSION=$(grep version binaries/cuprated/Cargo.toml | grep -oE [0-9]+.[0-9]+.[0-9]+)
61+
62+
# All archives have these files.
63+
cp LICENSE-AGPL target/release/LICENSE
64+
cp binaries/cuprated/config/Cuprated.toml target/release/
65+
66+
OS=${{ matrix.os }}
67+
68+
# Generate archives for Linux.
69+
if [ "$RUNNER_OS" == "Linux" ]; then
70+
# FIXME: <https://github.com/Cuprate/cuprate/issues/396>
71+
# cp binaries/cuprated/cuprated.service target/release/
72+
cd target/release
73+
74+
if [ "$OS" == "ubuntu-22.04" ]; then
75+
NAME="cuprated-${VERSION}-linux-x64.tar.gz"
76+
else
77+
NAME="cuprated-${VERSION}-linux-arm64.tar.gz"
78+
fi
79+
80+
# FIXME: #396
81+
# tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml cuprated.service
82+
tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml
83+
fi
84+
85+
# Generate archives for macOS.
86+
if [ "$RUNNER_OS" == "macOS" ]; then
87+
cd target/release
88+
89+
if [ "$OS" == "macos-15" ]; then
90+
NAME="cuprated-${VERSION}-macos-arm64.tar.gz"
91+
else
92+
NAME="cuprated-${VERSION}-macos-x64.tar.gz"
93+
fi
94+
95+
tar -czpf "$ARCHIVE/$NAME" cuprated LICENSE Cuprated.toml
96+
fi
97+
98+
# Generate archives for Windows.
99+
if [ "$RUNNER_OS" == "Windows" ]; then
100+
mv target/release/cuprated.exe target/release/
101+
cd target/release
102+
103+
NAME="cuprated-${VERSION}-windows-x64.zip"
104+
powershell Compress-Archive -LiteralPath cuprated.exe, LICENSE, Cuprated.toml -DestinationPath "$ARCHIVE/$NAME"
105+
fi
106+
107+
- name: Archive
108+
uses: actions/upload-artifact@v4
109+
with:
110+
name: ${{ matrix.os }}
111+
compression-level: 0
112+
path: ${{ env.ARCHIVE }}/**

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ target/
22
.vscode
33
monerod
44
books/*/book
5+
fast_sync_hashes.bin

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,11 @@ For crate (library) documentation, see: <https://doc.cuprate.org>. This site hol
5757

5858
## Contributing
5959

60-
See [`CONTRIBUTING.md`](CONTRIBUTING.md).
60+
See [`CONTRIBUTING.md`](misc/CONTRIBUTING.md).
6161

6262
## Security
6363

64-
Cuprate has a responsible vulnerability disclosure policy, see [`SECURITY.md`](SECURITY.md).
64+
Cuprate has a responsible vulnerability disclosure policy, see [`SECURITY.md`](misc/SECURITY.md).
6565

6666
## License
6767

consensus/fast-sync/src/create.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,8 @@ async fn main() {
7171

7272
drop(read_handle);
7373

74-
write(
75-
"data/fast_sync_hashes.bin",
76-
hashes_of_hashes.concat().as_slice(),
77-
)
78-
.expect("Could not write file");
74+
write("fast_sync_hashes.bin", hashes_of_hashes.concat().as_slice())
75+
.expect("Could not write file");
7976

8077
println!("Generated hashes up to block height {height}");
8178
}
File renamed without changes.

misc/FAST_SYNC_HASHES.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Fast sync hashes
2+
Cuprate has a binary that generate `fast-sync` hashes and puts them into a binary blob file.
3+
4+
The code that does so is located at [`consensus/fast-sync`](https://github.com/Cuprate/cuprate/blob/main/consensus/fast-sync).
5+
6+
To create the hashes, you need a fully synced database generated from `cuprated`.
7+
8+
After that, build the binary that generates `fast-sync` hashes:
9+
```bash
10+
cargo build --release --package cuprate-fast-sync
11+
```
12+
13+
Run the binary:
14+
```bash
15+
./target/release/create-fs-file --height $HEIGHT
16+
```
17+
where `$HEIGHT` is the top blockchain height.
18+
19+
The generated `fast_sync_hashes.bin` file should be in the current directory.
20+
21+
This should be moved to `binaries/cuprated/src/blockchain/fast_sync/fast_sync_hashes.bin`.

misc/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## Misc
2+
Any miscellaneous files, such as documents, GPG keys, assets, etc.

misc/RELEASE_CHECKLIST.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Cuprate release check-list
2+
This is a template checklist used to track releases.
3+
4+
The scheme for release file name is `$BINARY-$VERSION-$OS-$ARCH.$EXTENSION`, for example, `cuprated-0.0.1-linux-x64.tar.gz`.
5+
6+
---
7+
8+
- Changelog
9+
- [ ] Relevant changes added to `misc/changelogs/cuprated/$VERSION.md`
10+
- Fast sync
11+
- [ ] Update hashes, see `misc/FAST_SYNC_HASHES.md`
12+
- User Book
13+
- [ ] Update necessary documentation
14+
- [ ] Book title reflects `cuprated`'s version
15+
- `cuprated`
16+
- [ ] Killswitch timestamp updated
17+
- Repository
18+
- [ ] Decide specific commit
19+
- [ ] Create draft release
20+
- [ ] Create version tag
21+
- [ ] Build CI binaries
22+
- `cuprated` testing
23+
- Full-sync from scratch
24+
- [ ] x64 Windows
25+
- [ ] x64 Linux
26+
- [ ] ARM64 macOS
27+
- [ ] ARM64 Linux
28+
- Release
29+
- [ ] Add binaries to release
30+
- [ ] Publish `Cuprate/user-book`
31+
- [ ] Release
32+
- Release announcements
33+
- [ ] Reddit
34+
- [ ] Matrix

0 commit comments

Comments
 (0)