From b6f3729b41cc7863b3d14226a4b879305a25b5e3 Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 2 Sep 2026 15:15:46 +0800 Subject: [PATCH 1/5] feat(ci): add sccache Signed-off-by: Emin --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cb09d59..400d8cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,9 @@ jobs: with: submodules: recursive + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.10 + - name: Install build dependencies run: bash .github/scripts/install-build-deps.sh From 11fe6d57d601da62df2d7fea4ec68d3619129708 Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 2 Sep 2026 15:23:30 +0800 Subject: [PATCH 2/5] feat(ci): allow injecting Sizer version into build script Accept the bare semantic version through the SIZER_VERSION environment variable so the release workflow can align the embedded OPENROAD_VERSION with the pushed tag. Defaults to 0.1.0-alpha to keep local and CI builds unchanged. --- .github/scripts/build-sizer.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/build-sizer.sh b/.github/scripts/build-sizer.sh index 15dc08d..aac5905 100755 --- a/.github/scripts/build-sizer.sh +++ b/.github/scripts/build-sizer.sh @@ -34,7 +34,7 @@ cmake -S . -B build \ -DABC_SKIP_TESTS=ON \ -DBUILD_PYTHON=OFF \ -DUSE_SYSTEM_OPENSTA=OFF \ - -DOPENROAD_VERSION=v0.1.0-alpha \ + -DOPENROAD_VERSION="v${SIZER_VERSION:-0.1.0-alpha}" \ -DENABLE_PROFILER="${ENABLE_PROFILER:-OFF}" \ -DCUDD_DIR="${cudd_dir}" \ -DZLIB_HOME=/usr/lib/x86_64-linux-gnu \ From c2b32f3629a99bff4cd278b643f36ec7da4e5fcb Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 2 Sep 2026 15:26:56 +0800 Subject: [PATCH 3/5] feat(ci): extract reusable build workflow Move the Linux x64 build, package, and artifact upload steps from ci.yml into a workflow_call-based build.yml so the upcoming release workflow can reuse the exact same pipeline. The new version input lets callers produce versioned package names; CI keeps using the unversioned defaults. --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 26 +--------------- 2 files changed, 61 insertions(+), 25 deletions(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1c5cd6e --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Build + +on: + workflow_call: + inputs: + version: + description: >- + Bare semantic version (e.g. 0.1.0-alpha) embedded into the binary + and the package name. Empty keeps the default unversioned package. + type: string + default: '' + outputs: + archive-name: + description: File name of the packaged tarball inside the artifact. + value: ${{ jobs.build-linux-x64.outputs.archive-name }} + +jobs: + build-linux-x64: + name: Build Linux x64 + runs-on: ubuntu-22.04 + outputs: + archive-name: ${{ steps.package.outputs.archive-name }} + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup sccache + uses: mozilla-actions/sccache-action@v0.0.10 + + - name: Install build dependencies + run: bash .github/scripts/install-build-deps.sh + + - name: Build Sizer + run: .github/scripts/build-sizer.sh + env: + SIZER_VERSION: ${{ inputs.version }} + + - name: Package Sizer with runtime wrapper + id: package + env: + VERSION: ${{ inputs.version }} + run: | + package_name="ecc-sizer" + archive_name="ecc-sizer-linux-x64.tar.gz" + if [[ -n "${VERSION}" ]]; then + package_name="ecc-sizer-${VERSION}" + archive_name="${package_name}-linux-x64.tar.gz" + fi + PACKAGE_NAME="${package_name}" ARCHIVE_NAME="${archive_name}" \ + .github/scripts/package-sizer.sh + echo "archive-name=${archive_name}" >> "${GITHUB_OUTPUT}" + + - name: Upload binary package + uses: actions/upload-artifact@v4 + with: + name: ecc-sizer-linux-x64 + path: dist/*.tar.gz + if-no-files-found: error diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 400d8cd..479ece1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,28 +15,4 @@ concurrency: jobs: build-linux-x64: name: Build Linux x64 - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Setup sccache - uses: mozilla-actions/sccache-action@v0.0.10 - - - name: Install build dependencies - run: bash .github/scripts/install-build-deps.sh - - - name: Build Sizer - run: .github/scripts/build-sizer.sh - - - name: Package Sizer with runtime wrapper - run: .github/scripts/package-sizer.sh - - - name: Upload binary package - uses: actions/upload-artifact@v4 - with: - name: ecc-sizer-linux-x64 - path: dist/ecc-sizer-linux-x64.tar.gz - if-no-files-found: error + uses: ./.github/workflows/build.yml From 59ebf4311e6c7f47fcd645fa04657664a0fe53fe Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 2 Sep 2026 15:31:05 +0800 Subject: [PATCH 4/5] feat(ci): add tag-triggered release workflow Pushing a v* tag now verifies the tag against the version in default.nix, reuses the shared build workflow to produce a versioned tarball, and publishes a GitHub Release with the archive and its SHA256 checksums. Tags carrying a prerelease suffix are published as prereleases. --- .github/workflows/release.yml | 68 +++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..fe877c9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + tags: + - 'v*' + +permissions: + contents: write + +concurrency: + group: release-${{ github.ref_name }} + cancel-in-progress: false + +jobs: + verify: + name: Verify release tag + runs-on: ubuntu-22.04 + outputs: + version: ${{ steps.check.outputs.version }} + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Check tag against default.nix version + id: check + run: | + version="${GITHUB_REF_NAME#v}" + nix_version="$(grep -oP 'version = "\K[^"]+' default.nix | head -1)" + echo "tag version: ${version}" + echo "default.nix version: ${nix_version}" + if [[ "${version}" != "${nix_version}" ]]; then + echo "::error::Tag ${GITHUB_REF_NAME} does not match the version \"${nix_version}\" in default.nix. Bump the version and retag." + exit 1 + fi + echo "version=${version}" >> "${GITHUB_OUTPUT}" + + build: + name: Build release package + needs: verify + uses: ./.github/workflows/build.yml + with: + version: ${{ needs.verify.outputs.version }} + + release: + name: Publish GitHub Release + needs: + - verify + - build + runs-on: ubuntu-22.04 + steps: + - name: Download package artifact + uses: actions/download-artifact@v4 + with: + name: ecc-sizer-linux-x64 + + - name: Generate checksums + run: sha256sum -- *.tar.gz > SHA256SUMS.txt + + - name: Publish release + uses: softprops/action-gh-release@v2 + with: + files: | + *.tar.gz + SHA256SUMS.txt + fail_on_unmatched_files: true + generate_release_notes: true + prerelease: ${{ contains(github.ref_name, '-') }} From f529a33ce395d8f502d9d90f07b529a643542144 Mon Sep 17 00:00:00 2001 From: Emin Date: Wed, 2 Sep 2026 15:35:15 +0800 Subject: [PATCH 5/5] docs: document the tag-based release process --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index a238a98..84c7f58 100644 --- a/README.md +++ b/README.md @@ -144,6 +144,26 @@ git -C thirdparty/OpenROAD/src/sta status --short --branch git -C thirdparty/OpenROAD/third-party/abc status --short --branch ``` +## Releasing + +Releases are published by pushing a version tag. The Release workflow +verifies the tag, rebuilds the self-contained Linux x64 package, and +publishes a GitHub Release with the tarball and its SHA256 checksums. + +1. Bump the version in `default.nix` and the `SIZER_VERSION` default in + `.github/scripts/build-sizer.sh`, then merge the change to `main`. +2. Tag the release commit and push the tag: + + ```bash + git tag -a v0.1.0-alpha -m "Sizer 0.1.0-alpha" + git push origin v0.1.0-alpha + ``` + +The tag must match the `version` field in `default.nix` (without the +leading `v`), otherwise the workflow fails before building. Tags carrying +a prerelease suffix (for example `-alpha` or `-rc.1`) are published as +prereleases. + ## References - [TritonSizer](https://github.com/The-OpenROAD-Project/TritonSizer)