Skip to content
Merged

Dev #71

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,13 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install dist
# we specify bash to get pipefail; it guards against the `curl` command
# failing. otherwise `sh` won't catch that `curl` returned non-0
shell: bash
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.28.2/cargo-dist-installer.sh | sh"
run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.29.0/cargo-dist-installer.sh | sh"
- name: Cache dist
uses: actions/upload-artifact@v4
with:
Expand All @@ -76,7 +77,6 @@ jobs:
# but also really annoying to build CI around when it needs secrets to work right.)
- id: plan
run: |
cd server
dist ${{ (!github.event.pull_request && format('host --steps=create --tag={0}', github.ref_name)) || 'plan' }} --output-format=json > plan-dist-manifest.json
echo "dist ran successfully"
cat plan-dist-manifest.json
Expand All @@ -85,7 +85,7 @@ jobs:
uses: actions/upload-artifact@v4
with:
name: artifacts-plan-dist-manifest
path: server/plan-dist-manifest.json
path: plan-dist-manifest.json

# Build and packages all the platform-specific things
build-local-artifacts:
Expand Down Expand Up @@ -118,6 +118,7 @@ jobs:
git config --global core.longpaths true
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- uses: actions/setup-node@v4
with:
Expand All @@ -143,11 +144,10 @@ jobs:
${{ matrix.packages_install }}
- name: Build artifacts
run: |
cd server
./bt prerelease
builder/bt prerelease
# Actually do builds and make zips and whatnot
dist build ${{ needs.plan.outputs.tag-flag }} --print=linkage --output-format=json ${{ matrix.dist_args }} > dist-manifest.json
./bt postrelease ${{ matrix.dist_args }}
builder/bt postrelease ${{ matrix.dist_args }}
echo "dist ran successfully"
- id: cargo-dist
name: Post-build
Expand All @@ -156,7 +156,6 @@ jobs:
# inconsistent syntax between shell and powershell.
shell: bash
run: |
cd server
# Parse out what we just built and upload it to scratch storage
echo "paths<<EOF" >> "$GITHUB_OUTPUT"
dist print-upload-files-from-manifest --manifest dist-manifest.json >> "$GITHUB_OUTPUT"
Expand Down Expand Up @@ -186,6 +185,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install cached dist
uses: actions/download-artifact@v4
Expand All @@ -198,7 +198,7 @@ jobs:
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: server/target/distrib/
path: target/distrib/
merge-multiple: true
- id: cargo-dist
shell: bash
Expand Down Expand Up @@ -240,6 +240,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
- name: Install cached dist
uses: actions/download-artifact@v4
Expand All @@ -252,12 +253,11 @@ jobs:
uses: actions/download-artifact@v4
with:
pattern: artifacts-*
path: server/target/distrib/
path: target/distrib/
merge-multiple: true
- id: host
shell: bash
run: |
cd server
dist host ${{ needs.plan.outputs.tag-flag }} --steps=upload --steps=release --output-format=json > dist-manifest.json
echo "artifacts uploaded and released successfully"
cat dist-manifest.json
Expand All @@ -267,7 +267,7 @@ jobs:
with:
# Overwrite the previous copy
name: artifacts-dist-manifest
path: server/dist-manifest.json
path: dist-manifest.json
# Create a GitHub Release while uploading all files to it
- name: "Download GitHub Artifacts"
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -305,4 +305,5 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
submodules: recursive
7 changes: 7 additions & 0 deletions builder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions builder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@ edition = "2024"
clap = { version = "4.5.19", features = ["derive"] }
cmd_lib = "1.9.5"
current_platform = "0.2.0"
dunce = "1.0.5"
path-slash = "0.2.1"
regex = "1.11.1"
9 changes: 9 additions & 0 deletions builder/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
//
// ### Standard library
use std::{
env,
ffi::OsStr,
fs, io,
path::{Path, PathBuf},
Expand All @@ -42,6 +43,7 @@ use std::{
use clap::{Parser, Subcommand};
use cmd_lib::run_cmd;
use current_platform::CURRENT_PLATFORM;
use dunce::canonicalize;
use path_slash::PathBufExt;
use regex::Regex;

Expand Down Expand Up @@ -575,6 +577,13 @@ impl Cli {
}

fn main() -> io::Result<()> {
// Change to the `server/` directory, so it can be run from anywhere.
let mut root_path = PathBuf::from(env::current_exe().unwrap().parent().unwrap());
root_path.push("../../../server");
// Use `dunce.canonicalize`, since UNC paths booger up some of the build tools (cargo can't delete the builder's binary, NPM doesn't accept UNC paths.)
root_path = canonicalize(root_path).unwrap();
env::set_current_dir(root_path).unwrap();

let cli = Cli::parse();
cli.run()?;

Expand Down
Loading
Loading