Skip to content

Commit 25f3a0b

Browse files
authored
Merge branch 'dpc:master' into master
2 parents efebfbe + 7ab4e97 commit 25f3a0b

File tree

4 files changed

+312
-30
lines changed

4 files changed

+312
-30
lines changed

.github/workflows/ci.yml

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
name: "Release packages"
2+
3+
on:
4+
push:
5+
branches: [ "main", "master", "devel", "releases/v*" ]
6+
tags:
7+
- 'v*'
8+
pull_request:
9+
branches: [ "main", "master", "devel", "releases/v*" ]
10+
merge_group:
11+
branches: [ "main", "master", "devel", "releases/v*" ]
12+
13+
workflow_dispatch:
14+
15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: true
18+
19+
20+
jobs:
21+
lint:
22+
name: "Lint"
23+
runs-on: ubuntu-latest
24+
timeout-minutes: 30
25+
steps:
26+
- uses: actions/checkout@v4
27+
- uses: dpc/nix-installer-action@dpc/jj-vqymqvyntouw
28+
- uses: cachix/cachix-action@v15
29+
with:
30+
name: rostra
31+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
32+
continue-on-error: true
33+
34+
- name: Check `nix flake show`
35+
run: nix flake show .#
36+
37+
38+
39+
pkg:
40+
name: "Build packages"
41+
runs-on: ubuntu-latest
42+
timeout-minutes: 30
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: dpc/nix-installer-action@dpc/jj-vqymqvyntouw
46+
- uses: cachix/cachix-action@v15
47+
with:
48+
name: rostra
49+
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
50+
continue-on-error: true
51+
52+
53+
- name: Set BUILD_ID to tag or commit hash
54+
run: |
55+
if [[ $GITHUB_REF_TYPE == "tag" ]]; then
56+
echo "BUILD_ID=${GITHUB_REF_NAME}" >> $GITHUB_ENV
57+
else
58+
echo "BUILD_ID=${GITHUB_SHA}" >> $GITHUB_ENV
59+
fi
60+
61+
- name: Build rostra
62+
env:
63+
# seems like cachix needs this explicitly set in the env
64+
CACHIX_AUTH_TOKEN: '${{ secrets.CACHIX_AUTH_TOKEN }}'
65+
run: |
66+
mkdir -p bins
67+
nix build -L .#rostra && sha256sum "./result/bin/rostra"
68+
69+
closure_size=$(nix path-info -rS --json .#rostra | jq '. | to_entries[] | select(.value.ultimate == true) | .value.narSize')
70+
>&2 echo "rostra's Nix closure size: $closure_size"
71+
72+
if [ 100000000 -lt $closure_size ]; then
73+
>&2 echo "rostra's Nix closure size seems too big: $closure_size"
74+
exit 1
75+
fi
76+
77+
nix bundle --bundler .# ".#rostra" -o "bins/rostra-$BUILD_ID" && sha256sum "bins/rostra-$BUILD_ID"
78+
79+
- name: Upload Binaries
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: "rostra-linux-x86_64"
83+
path: "bins/**"
84+
85+
- name: Release Binaries
86+
uses: softprops/action-gh-release@v2
87+
if: startsWith(github.ref, 'refs/tags/')
88+
with:
89+
files: "bins/**"
90+
prerelease: ${{ contains(github.ref, 'rc') }}
91+
body: ${{ contains(github.ref, 'rc') && env.PRERELEASE_MESSAGE || '' }}
92+
93+
- name: Build DEB package
94+
run: |
95+
nix bundle -L --bundler .#toDEB --accept-flake-config -o debs/rostra .#rostra
96+
# workaround: https://github.com/actions/upload-artifact/issues/92
97+
cp -a debs/rostra/*.deb debs/
98+
99+
- name: Build RPM package
100+
run: |
101+
nix bundle -L --bundler .#toRPM --accept-flake-config -o rpms/rostra .#rostra
102+
# workaround: https://github.com/actions/upload-artifact/issues/92
103+
cp -a rpms/rostra/*.rpm rpms/
104+
105+
- name: Upload DEB packages
106+
uses: actions/upload-artifact@v4
107+
with:
108+
name: "rostra-deb-bundle"
109+
path: "debs/**.deb"
110+
111+
- name: Release DEB packages
112+
uses: softprops/action-gh-release@v2
113+
if: startsWith(github.ref, 'refs/tags/')
114+
with:
115+
files: "debs/**.deb"
116+
prerelease: ${{ contains(github.ref, 'rc') }}
117+
body: ${{ contains(github.ref, 'rc') && env.PRERELEASE_MESSAGE || '' }}
118+
119+
- name: Upload RPM packages
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: "rostra-rpm-bundle"
123+
path: "rpms/**.rpm"
124+
125+
- name: Release RPM packages
126+
uses: softprops/action-gh-release@v2
127+
if: startsWith(github.ref, 'refs/tags/')
128+
with:
129+
files: "rpms/**.rpm"
130+
prerelease: ${{ contains(github.ref, 'rc') }}
131+
body: ${{ contains(github.ref, 'rc') && env.PRERELEASE_MESSAGE || '' }}

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,18 @@ To verify that the above is working well, login to your above localhost web-ui u
5050

5151
#### Using Cargo
5252

53-
**NOTE**: [This flow currently doesn't work end to end](https://github.com/dpc/rostra/discussions/7).
54-
55-
As a Rust project Rostra can be installed using Cargo:
53+
You can clone the git repository locally and run:
5654

5755
```
58-
cargo install --git https://github.com/dpc/rostra
56+
cargo run --release web-ui
5957
```
6058

59+
to start the web ui.
60+
61+
**NOTE**: [`cargo install` can't bundle web UI assets embedded in the git
62+
repository, which are necessary for the web UI to work.](https://github.com/dpc/rostra/discussions/7).
63+
64+
6165
#### Using Nix
6266

6367
You can run Rostra using Nix with:
@@ -66,6 +70,18 @@ You can run Rostra using Nix with:
6670
nix run github:dpc/rostra
6771
```
6872

73+
#### Using prebuilt binaries
74+
75+
The [CI builds binaries](https://github.com/dpc/rostra/actions/workflows/ci.yml?query=branch%3Amaster):
76+
77+
* portable Linux x86_64 binary
78+
* DEB package
79+
* RPM package
80+
81+
Pick the last build and at the bottom of the page look for "Artifacts".
82+
83+
In the future, the official releases will come with prebuilt binaries as well.
84+
6985
## Plan
7086

7187
Status: early, but getting to something usable.

0 commit comments

Comments
 (0)