Skip to content
Open
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
30 changes: 30 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
14 changes: 8 additions & 6 deletions cli/magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -292,16 +296,16 @@ 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)),
shellcmd.Command(fmt.Sprintf("cp %s/cli/maestro %s", symphonyPath, des)),
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
}
Expand Down Expand Up @@ -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 {
Expand Down
Loading