From 4df6140817e0e2fb46545ec29f0533dc27626447 Mon Sep 17 00:00:00 2001 From: Haishi Bai Date: Tue, 16 Jun 2026 12:14:20 -0700 Subject: [PATCH] pipleine updates --- .github/workflows/release.yaml | 30 +++++++++++++++++++ .../providers/target/rust/symphony/Cargo.toml | 2 +- cli/magefile.go | 14 +++++---- 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 0c7d21e6a..e4b798f91 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -128,6 +128,17 @@ jobs: echo $new_version > .github/version/versions.txt echo "version=$new_version" >> $GITHUB_OUTPUT + - name: Align symphony crate version + id: increment_crate_version + run: | + version=$(cat .github/version/versions.txt) + crate_manifest=api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml + # Align the crate version with the system version, replacing only the + # first (package) version line and leaving workspace deps untouched + sed -i "0,/^version = \".*\"/s//version = \"$version\"/" "$crate_manifest" + echo "Set symphony crate version to $version" + echo "crate_version=$version" >> $GITHUB_OUTPUT + - name: Replace version in cli/cmd/up.go run: | version=$(cat .github/version/versions.txt) @@ -139,6 +150,24 @@ jobs: mage generatePackages /home/runner/maestro cd .. + - name: Publish symphony crate to crates.io + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + CRATE_VERSION: ${{ steps.increment_crate_version.outputs.crate_version }} + run: | + cd api/pkg/apis/v1alpha1/providers/target/rust + # Skip if this version is already published (e.g. on a pipeline re-run), + # since crates.io rejects re-publishing an existing version. crates.io + # requires a descriptive User-Agent for automated index access. + published=$(curl -s -H "User-Agent: symphony-release-ci (${BOT_EMAIL_ID})" \ + "https://index.crates.io/sy/mp/symphony" | grep -o "\"vers\":\"${CRATE_VERSION}\"" || true) + if [ -n "$published" ]; then + echo "symphony ${CRATE_VERSION} is already published on crates.io, skipping." + else + # --allow-dirty: the version bump and other release edits are not committed yet + cargo publish -p symphony --allow-dirty + fi + - name: Clean Rust artifacts run: | cd api/pkg/apis/v1alpha1/providers/target/rust @@ -207,6 +236,7 @@ jobs: git add .github/version/versions.txt git add packages/helm/symphony/Chart.yaml git add cli/cmd/up.go + git add api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml git commit -m "Bump version to ${{ steps.increment_version.outputs.version }}" - name: Push changes diff --git a/api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml b/api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml index 65bb12c49..2ed3dc5bc 100644 --- a/api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml +++ b/api/pkg/apis/v1alpha1/providers/target/rust/symphony/Cargo.toml @@ -4,7 +4,7 @@ [package] name = "symphony" -version = "0.1.5" +version = "0.49.3" edition = { workspace = true } license = "MIT" description = "Eclipse Symphony Target Provider Rust binding" diff --git a/cli/magefile.go b/cli/magefile.go index 8e2f8499a..5f76efe78 100644 --- a/cli/magefile.go +++ b/cli/magefile.go @@ -156,6 +156,10 @@ func BuildApi() error { env: []string{"CC=arm-linux-gnueabihf-gcc", "CGO_ENABLED=1", "GOARCH=arm", "GOARM=7"}, args: []string{"go", "build", "-o", "symphony-api-arm"}, }, + { // Windows x86_64 (MinGW cross-compile) + env: []string{"CC=x86_64-w64-mingw32-gcc", "CXX=x86_64-w64-mingw32-g++", "CGO_ENABLED=1", "GOOS=windows", "GOARCH=amd64"}, + args: []string{"go", "build", "-o", "symphony-api.exe"}, + }, { // Linux x86_64 env: []string{ "CGO_ENABLED=1", @@ -292,8 +296,8 @@ func GeneratePackages(des string) error { shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api-arm64 %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api-arm %s", symphonyPath, des)), - // TODO: Re-enable Mac and Windows cross build - // shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api.exe %s", symphonyPath, des)), + shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api.exe %s", symphonyPath, des)), + // TODO: Re-enable Mac cross build // shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api-mac %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-agent.json %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/api/symphony-api-no-k8s.json %s", symphonyPath, des)), @@ -301,7 +305,7 @@ func GeneratePackages(des string) error { shellcmd.Command(fmt.Sprintf("cp %s/cli/maestro-arm64 %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/cli/maestro-arm %s", symphonyPath, des)), shellcmd.Command(fmt.Sprintf("cp %s/cli/maestro.exe %s", symphonyPath, des)), - shellcmd.Command(fmt.Sprintf("cp %s//cli/maestro-mac %s", symphonyPath, des)), + shellcmd.Command(fmt.Sprintf("cp %s/cli/maestro-mac %s", symphonyPath, des)), ); err != nil { return err } @@ -354,9 +358,7 @@ func GeneratePackages(des string) error { } // package windows - // windowsCommand := fmt.Sprintf("zip -r maestro_windows_amd64.zip maestro.exe symphony-api.exe symphony-api-no-k8s.json samples.json %s", sampleRootArgs) - // TODO: re-enable windows package - windowsCommand := fmt.Sprintf("zip -r maestro_windows_amd64.zip maestro.exe symphony-api-no-k8s.json samples.json %s", sampleRootArgs) + windowsCommand := fmt.Sprintf("zip -r maestro_windows_amd64.zip maestro.exe symphony-api.exe symphony-api-no-k8s.json samples.json %s", sampleRootArgs) if err := shellcmd.RunAll( shellcmd.Command(windowsCommand), ); err != nil {