Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .github/scripts/build-sizer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
60 changes: 60 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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
23 changes: 1 addition & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +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: 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
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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, '-') }}
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading