Skip to content

Commit 36f1537

Browse files
daddycocoamannriosBF
authored andcommitted
initial release
docs: remove graph card from readme
0 parents  commit 36f1537

82 files changed

Lines changed: 25503 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.dockerignore

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Created by https://www.toptal.com/developers/gitignore/api/rust,rust-analyzer,visualstudiocode
2+
# Edit at https://www.toptal.com/developers/gitignore?templates=rust,rust-analyzer,visualstudiocode
3+
4+
### Rust ###
5+
# Generated by Cargo
6+
# will have compiled files and executables
7+
debug/
8+
target/
9+
10+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
11+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
12+
Cargo.lock
13+
14+
# These are backup files generated by rustfmt
15+
**/*.rs.bk
16+
17+
# MSVC Windows builds of rustc generate these, which store debugging information
18+
*.pdb
19+
20+
### rust-analyzer ###
21+
# Can be generated by other build systems other than cargo (ex: bazelbuild/rust_rules)
22+
rust-project.json
23+
24+
25+
### VisualStudioCode ###
26+
.vscode/*
27+
!.vscode/settings.json
28+
!.vscode/tasks.json
29+
!.vscode/launch.json
30+
!.vscode/extensions.json
31+
!.vscode/*.code-snippets
32+
33+
# Local History for Visual Studio Code
34+
.history/
35+
36+
# Built Visual Studio Code Extensions
37+
*.vsix
38+
39+
### VisualStudioCode Patch ###
40+
# Ignore all local history of files
41+
.history
42+
.ionide
43+
44+
# End of https://www.toptal.com/developers/gitignore/api/rust,rust-analyzer,visualstudiocode
45+
46+
47+
# Node.js
48+
node_modules/
49+
dist/
50+
51+
# Rust
52+
target/
53+
54+
# Git
55+
.git/
56+
.gitignore
57+
58+
# Docker
59+
Dockerfile
60+
.dockerignore
61+
62+
# CI/CD
63+
.github/
64+
65+
# Documentation
66+
*.md
67+
LICENSE

.github/build-setup.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Do not put this in workflows folder
2+
- name: Setup Node
3+
uses: actions/setup-node@v4
4+
with:
5+
node-version: 24
6+
cache: npm
7+
cache-dependency-path: web/package-lock.json
8+
9+
- name: Install web deps
10+
run: |
11+
cd web
12+
npm ci
13+
14+
- name: Build web
15+
run: |
16+
cd web
17+
npm run build

.github/workflows/release.yml

Lines changed: 310 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,310 @@
1+
# This file was autogenerated by dist: https://axodotdev.github.io/cargo-dist
2+
#
3+
# Copyright 2022-2024, axodotdev
4+
# SPDX-License-Identifier: MIT or Apache-2.0
5+
#
6+
# CI that:
7+
#
8+
# * checks for a Git Tag that looks like a release
9+
# * builds artifacts with dist (archives, installers, hashes)
10+
# * uploads those artifacts to temporary workflow zip
11+
# * on success, uploads the artifacts to a GitHub Release
12+
#
13+
# Note that the GitHub Release will be created with a generated
14+
# title/body based on your changelogs.
15+
16+
name: Release
17+
permissions:
18+
"contents": "write"
19+
20+
# This task will run whenever you push a git tag that looks like a version
21+
# like "1.0.0", "v0.1.0-prerelease.1", "my-app/0.1.0", "releases/v1.0.0", etc.
22+
# Various formats will be parsed into a VERSION and an optional PACKAGE_NAME, where
23+
# PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION
24+
# must be a Cargo-style SemVer Version (must have at least major.minor.patch).
25+
#
26+
# If PACKAGE_NAME is specified, then the announcement will be for that
27+
# package (erroring out if it doesn't have the given version or isn't dist-able).
28+
#
29+
# If PACKAGE_NAME isn't specified, then the announcement will be for all
30+
# (dist-able) packages in the workspace with that version (this mode is
31+
# intended for workspaces with only one dist-able package, or with all dist-able
32+
# packages versioned/released in lockstep).
33+
#
34+
# If you push multiple tags at once, separate instances of this workflow will
35+
# spin up, creating an independent announcement for each one. However, GitHub
36+
# will hard limit this to 3 tags per commit, as it will assume more tags is a
37+
# mistake.
38+
#
39+
# If there's a prerelease-style suffix to the version, then the release(s)
40+
# will be marked as a prerelease.
41+
on:
42+
pull_request:
43+
push:
44+
tags:
45+
- '**[0-9]+.[0-9]+.[0-9]+*'
46+
47+
jobs:
48+
# Run 'dist plan' (or host) to determine what tasks we need to do
49+
plan:
50+
runs-on: "ubuntu-22.04"
51+
outputs:
52+
val: ${{ steps.plan.outputs.manifest }}
53+
tag: ${{ !github.event.pull_request && github.ref_name || '' }}
54+
tag-flag: ${{ !github.event.pull_request && format('--tag={0}', github.ref_name) || '' }}
55+
publishing: ${{ !github.event.pull_request }}
56+
env:
57+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
steps:
59+
- uses: actions/checkout@v4
60+
with:
61+
persist-credentials: false
62+
submodules: recursive
63+
- name: Install dist
64+
# we specify bash to get pipefail; it guards against the `curl` command
65+
# failing. otherwise `sh` won't catch that `curl` returned non-0
66+
shell: bash
67+
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.30.2/cargo-dist-installer.sh | sh"
68+
- name: Cache dist
69+
uses: actions/upload-artifact@v4
70+
with:
71+
name: cargo-dist-cache
72+
path: ~/.cargo/bin/dist
73+
# sure would be cool if github gave us proper conditionals...
74+
# so here's a doubly-nested ternary-via-truthiness to try to provide the best possible
75+
# functionality based on whether this is a pull_request, and whether it's from a fork.
76+
# (PRs run on the *source* but secrets are usually on the *target* -- that's *good*
77+
# but also really annoying to build CI around when it needs secrets to work right.)
78+
- id: plan
79+
run: |
80+
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
81+
echo "dist ran successfully"
82+
cat plan-dist-manifest.json
83+
echo "manifest=$(jq -c "." plan-dist-manifest.json)" >> "$GITHUB_OUTPUT"
84+
- name: "Upload dist-manifest.json"
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: artifacts-plan-dist-manifest
88+
path: plan-dist-manifest.json
89+
90+
# Build and packages all the platform-specific things
91+
build-local-artifacts:
92+
name: build-local-artifacts (${{ join(matrix.targets, ', ') }})
93+
# Let the initial task tell us to not run (currently very blunt)
94+
needs:
95+
- plan
96+
if: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix.include != null && (needs.plan.outputs.publishing == 'true' || fromJson(needs.plan.outputs.val).ci.github.pr_run_mode == 'upload') }}
97+
strategy:
98+
fail-fast: false
99+
# Target platforms/runners are computed by dist in create-release.
100+
# Each member of the matrix has the following arguments:
101+
#
102+
# - runner: the github runner
103+
# - dist-args: cli flags to pass to dist
104+
# - install-dist: expression to run to install dist on the runner
105+
#
106+
# Typically there will be:
107+
# - 1 "global" task that builds universal installers
108+
# - N "local" tasks that build each platform's binaries and platform-specific installers
109+
matrix: ${{ fromJson(needs.plan.outputs.val).ci.github.artifacts_matrix }}
110+
runs-on: ${{ matrix.runner }}
111+
container: ${{ matrix.container && matrix.container.image || null }}
112+
env:
113+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
114+
BUILD_MANIFEST_NAME: target/distrib/${{ join(matrix.targets, '-') }}-dist-manifest.json
115+
steps:
116+
- name: enable windows longpaths
117+
run: |
118+
git config --global core.longpaths true
119+
- uses: actions/checkout@v4
120+
with:
121+
persist-credentials: false
122+
submodules: recursive
123+
- name: Install Rust non-interactively if not already installed
124+
if: ${{ matrix.container }}
125+
run: |
126+
if ! command -v cargo > /dev/null 2>&1; then
127+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
128+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
129+
fi
130+
- name: "Setup Node"
131+
uses: "actions/setup-node@v4"
132+
with:
133+
"cache": "npm"
134+
"cache-dependency-path": "web/package-lock.json"
135+
"node-version": 24
136+
- name: "Install web deps"
137+
run: |
138+
cd web
139+
npm ci
140+
- name: "Build web"
141+
run: |
142+
cd web
143+
npm run build
144+
- name: Install dist
145+
run: ${{ matrix.install_dist.run }}
146+
# Get the dist-manifest
147+
- name: Fetch local artifacts
148+
uses: actions/download-artifact@v4
149+
with:
150+
pattern: artifacts-*
151+
path: target/distrib/
152+
merge-multiple: true
153+
- name: Install dependencies
154+
run: |
155+
${{ matrix.packages_install }}
156+
- name: Build artifacts
157+
run: |
158+
# Actually do builds and make zips and whatnot
159+
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
160+
echo "dist ran successfully"
161+
- id: cargo-dist
162+
name: Post-build
163+
# We force bash here just because github makes it really hard to get values up
164+
# to "real" actions without writing to env-vars, and writing to env-vars has
165+
# inconsistent syntax between shell and powershell.
166+
shell: bash
167+
run: |
168+
# Parse out what we just built and upload it to scratch storage
169+
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
170+
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
171+
echo "EOF" >> "$GITHUB_OUTPUT"
172+
173+
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
174+
- name: "Upload artifacts"
175+
uses: actions/upload-artifact@v4
176+
with:
177+
name: artifacts-build-local-${{ join(matrix.targets, '_') }}
178+
path: |
179+
${{ steps.cargo-dist.outputs.paths }}
180+
${{ env.BUILD_MANIFEST_NAME }}
181+
182+
# Build and package all the platform-agnostic(ish) things
183+
build-global-artifacts:
184+
needs:
185+
- plan
186+
- build-local-artifacts
187+
runs-on: "ubuntu-22.04"
188+
env:
189+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190+
BUILD_MANIFEST_NAME: target/distrib/global-dist-manifest.json
191+
steps:
192+
- uses: actions/checkout@v4
193+
with:
194+
persist-credentials: false
195+
submodules: recursive
196+
- name: Install cached dist
197+
uses: actions/download-artifact@v4
198+
with:
199+
name: cargo-dist-cache
200+
path: ~/.cargo/bin/
201+
- run: chmod +x ~/.cargo/bin/dist
202+
# Get all the local artifacts for the global tasks to use (for e.g. checksums)
203+
- name: Fetch local artifacts
204+
uses: actions/download-artifact@v4
205+
with:
206+
pattern: artifacts-*
207+
path: target/distrib/
208+
merge-multiple: true
209+
- id: cargo-dist
210+
shell: bash
211+
run: |
212+
dist build ${{ needs.plan.outputs.tag-flag }} --output-format=json "--artifacts=global" > dist-manifest.json
213+
echo "dist ran successfully"
214+
215+
# Parse out what we just built and upload it to scratch storage
216+
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
217+
jq --raw-output ".upload_files[]" dist-manifest.json >> "$GITHUB_OUTPUT"
218+
echo "EOF" >> "$GITHUB_OUTPUT"
219+
220+
cp dist-manifest.json "$BUILD_MANIFEST_NAME"
221+
- name: "Upload artifacts"
222+
uses: actions/upload-artifact@v4
223+
with:
224+
name: artifacts-build-global
225+
path: |
226+
${{ steps.cargo-dist.outputs.paths }}
227+
${{ env.BUILD_MANIFEST_NAME }}
228+
# Determines if we should publish/announce
229+
host:
230+
needs:
231+
- plan
232+
- build-local-artifacts
233+
- build-global-artifacts
234+
# Only run if we're "publishing", and only if plan, local and global didn't fail (skipped is fine)
235+
if: ${{ always() && needs.plan.result == 'success' && needs.plan.outputs.publishing == 'true' && (needs.build-global-artifacts.result == 'skipped' || needs.build-global-artifacts.result == 'success') && (needs.build-local-artifacts.result == 'skipped' || needs.build-local-artifacts.result == 'success') }}
236+
env:
237+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
238+
runs-on: "ubuntu-22.04"
239+
outputs:
240+
val: ${{ steps.host.outputs.manifest }}
241+
steps:
242+
- uses: actions/checkout@v4
243+
with:
244+
persist-credentials: false
245+
submodules: recursive
246+
- name: Install cached dist
247+
uses: actions/download-artifact@v4
248+
with:
249+
name: cargo-dist-cache
250+
path: ~/.cargo/bin/
251+
- run: chmod +x ~/.cargo/bin/dist
252+
# Fetch artifacts from scratch-storage
253+
- name: Fetch artifacts
254+
uses: actions/download-artifact@v4
255+
with:
256+
pattern: artifacts-*
257+
path: target/distrib/
258+
merge-multiple: true
259+
- id: host
260+
shell: bash
261+
run: |
262+
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
263+
echo "artifacts uploaded and released successfully"
264+
cat dist-manifest.json
265+
echo "manifest=$(jq -c "." dist-manifest.json)" >> "$GITHUB_OUTPUT"
266+
- name: "Upload dist-manifest.json"
267+
uses: actions/upload-artifact@v4
268+
with:
269+
# Overwrite the previous copy
270+
name: artifacts-dist-manifest
271+
path: dist-manifest.json
272+
# Create a GitHub Release while uploading all files to it
273+
- name: "Download GitHub Artifacts"
274+
uses: actions/download-artifact@v4
275+
with:
276+
pattern: artifacts-*
277+
path: artifacts
278+
merge-multiple: true
279+
- name: Cleanup
280+
run: |
281+
# Remove the granular manifests
282+
rm -f artifacts/*-dist-manifest.json
283+
- name: Create GitHub Release
284+
env:
285+
PRERELEASE_FLAG: "${{ fromJson(steps.host.outputs.manifest).announcement_is_prerelease && '--prerelease' || '' }}"
286+
ANNOUNCEMENT_TITLE: "${{ fromJson(steps.host.outputs.manifest).announcement_title }}"
287+
ANNOUNCEMENT_BODY: "${{ fromJson(steps.host.outputs.manifest).announcement_github_body }}"
288+
RELEASE_COMMIT: "${{ github.sha }}"
289+
run: |
290+
# Write and read notes from a file to avoid quoting breaking things
291+
echo "$ANNOUNCEMENT_BODY" > $RUNNER_TEMP/notes.txt
292+
293+
gh release create "${{ needs.plan.outputs.tag }}" --target "$RELEASE_COMMIT" $PRERELEASE_FLAG --title "$ANNOUNCEMENT_TITLE" --notes-file "$RUNNER_TEMP/notes.txt" artifacts/*
294+
295+
announce:
296+
needs:
297+
- plan
298+
- host
299+
# use "always() && ..." to allow us to wait for all publish jobs while
300+
# still allowing individual publish jobs to skip themselves (for prereleases).
301+
# "host" however must run to completion, no skipping allowed!
302+
if: ${{ always() && needs.host.result == 'success' }}
303+
runs-on: "ubuntu-22.04"
304+
env:
305+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
306+
steps:
307+
- uses: actions/checkout@v4
308+
with:
309+
persist-credentials: false
310+
submodules: recursive

0 commit comments

Comments
 (0)