From 9d384030d3362e6d501b3be1b06e551e18d07fb9 Mon Sep 17 00:00:00 2001 From: Sandipsinh Dilipsinh Rathod <62684960+ssddOnTop@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:32:07 -0400 Subject: [PATCH 1/2] feat(ci): upload release build binaries as GitHub Actions artifacts --- .github/workflows/ci.yml | 8 ++++++ crates/forge_ci/src/jobs/release_build_job.rs | 27 +++++++++++++++++-- crates/forge_ci/src/workflows/ci.rs | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 084af85901..4dc23b8b21 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -292,5 +292,13 @@ jobs: RUSTFLAGS: ${{ env.RUSTFLAGS }} POSTHOG_API_SECRET: ${{secrets.POSTHOG_API_SECRET}} APP_VERSION: ${{ needs.draft_release_pr.outputs.crate_release_name }} + - name: Copy Binary + run: cp ${{ matrix.binary_path }} ${{ matrix.binary_name }} + - name: Upload Artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.binary_name }} + path: ${{ matrix.binary_name }} + retention-days: 7 concurrency: group: ${{ github.workflow }}-${{ github.ref }} diff --git a/crates/forge_ci/src/jobs/release_build_job.rs b/crates/forge_ci/src/jobs/release_build_job.rs index edd3a0662c..8197ec31ab 100644 --- a/crates/forge_ci/src/jobs/release_build_job.rs +++ b/crates/forge_ci/src/jobs/release_build_job.rs @@ -1,5 +1,6 @@ use derive_setters::Setters; use gh_workflow::*; +use serde_json::json; use crate::release_matrix::ReleaseMatrix; use crate::steps::setup_protoc; @@ -10,13 +11,16 @@ pub struct ReleaseBuilderJob { // Required to burn into the binary pub version: String, - // When provide the generated release will be uploaded + // When provided the generated release will be uploaded pub release_id: Option, + + // When true, upload built binaries as GitHub Actions artifacts + pub upload_artifact: Option, } impl ReleaseBuilderJob { pub fn new(version: impl AsRef) -> Self { - Self { version: version.as_ref().to_string(), release_id: None } + Self { version: version.as_ref().to_string(), release_id: None, upload_artifact: None } } pub fn into_job(self) -> Job { @@ -98,6 +102,25 @@ impl From for Job { ); } + if value.upload_artifact == Some(true) { + job = job + // Rename binary to target name for artifact upload + .add_step( + Step::new("Copy Binary") + .run("cp ${{ matrix.binary_path }} ${{ matrix.binary_name }}"), + ) + // Upload as GitHub Actions artifact + .add_step( + Step::new("Upload Artifact") + .uses("actions", "upload-artifact", "v4") + .with(Input::from(indexmap::indexmap! { + "name".to_string() => json!("${{ matrix.binary_name }}"), + "path".to_string() => json!("${{ matrix.binary_name }}"), + "retention-days".to_string() => json!(7), + })), + ); + } + job } } diff --git a/crates/forge_ci/src/workflows/ci.rs b/crates/forge_ci/src/workflows/ci.rs index 2b5d81174f..cfda721107 100644 --- a/crates/forge_ci/src/workflows/ci.rs +++ b/crates/forge_ci/src/workflows/ci.rs @@ -44,6 +44,7 @@ pub fn generate_ci_workflow() { ); let build_release_pr_job = ReleaseBuilderJob::new("${{ needs.draft_release_pr.outputs.crate_release_name }}") + .upload_artifact(true) .into_job() .add_needs("draft_release_pr") .cond(Expression::new( From b8847eae7f554d74ff39ca5e80f9d44c906b2e82 Mon Sep 17 00:00:00 2001 From: Sandipsinh Dilipsinh Rathod <62684960+ssddOnTop@users.noreply.github.com> Date: Tue, 10 Mar 2026 21:35:13 -0400 Subject: [PATCH 2/2] fix(ci): remove branches filter from pull_request trigger --- .github/workflows/ci.yml | 2 -- crates/forge_ci/src/workflows/ci.rs | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4dc23b8b21..0e14b48433 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,8 +26,6 @@ env: - synchronize - reopened - labeled - branches: - - main push: branches: - main diff --git a/crates/forge_ci/src/workflows/ci.rs b/crates/forge_ci/src/workflows/ci.rs index cfda721107..2af31bce71 100644 --- a/crates/forge_ci/src/workflows/ci.rs +++ b/crates/forge_ci/src/workflows/ci.rs @@ -39,8 +39,7 @@ pub fn generate_ci_workflow() { .add_type(PullRequestType::Opened) .add_type(PullRequestType::Synchronize) .add_type(PullRequestType::Reopened) - .add_type(PullRequestType::Labeled) - .add_branch("main"), + .add_type(PullRequestType::Labeled), ); let build_release_pr_job = ReleaseBuilderJob::new("${{ needs.draft_release_pr.outputs.crate_release_name }}")