-
Notifications
You must be signed in to change notification settings - Fork 0
Ship prebuilt binaries and a --tunnel flag for easy local runs #19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
a29ee88
Ship prebuilt binaries and a --tunnel flag for easy local runs
claude 0f1b7e4
Address Copilot review on release workflow + README
claude bfac8e0
Fix --help OAUTH_CLIENTS_FILE default to match the code exactly
claude 7fedeeb
Gitignore the OAuth client-registration runtime file
claude 58aa8ba
Address Copilot review: README accuracy fixes
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,120 @@ | ||
| # Build prebuilt binaries and publish them to a GitHub Release. | ||
| # | ||
| # Push a version tag (`git tag v0.1.0 && git push --tags`) to build a | ||
| # self-contained binary for each platform and attach it to a DRAFT release for | ||
| # review. Or run manually (Actions -> Release binaries -> Run workflow) to build | ||
| # the binaries as downloadable run artifacts without cutting a release. | ||
| # | ||
| # The binary is fully self-contained: the only static assets (the Candid cheat | ||
| # sheets and HTML pages) are baked in at compile time via include_str!, so each | ||
| # release asset is a single executable — download, extract, run. | ||
| # | ||
| # We build NATIVELY on a runner per target (no cross-compiling): the rustls | ||
| # crypto backend (aws-lc-sys) needs cmake + a C toolchain and is painful to | ||
| # cross-build or link against musl, so native builds are the reliable path. The | ||
| # Linux gnu binaries are built on Ubuntu 22.04 (glibc 2.35); for older distros, | ||
| # use the Dockerfile instead. | ||
| name: Release binaries | ||
|
|
||
| on: | ||
| push: | ||
| tags: ["v*"] | ||
| workflow_dispatch: | ||
|
|
||
| # contents: write is needed to create the release and upload assets. | ||
| permissions: | ||
| contents: write | ||
|
|
||
| concurrency: | ||
| group: release-${{ github.ref }} | ||
| cancel-in-progress: false | ||
|
|
||
| jobs: | ||
| build: | ||
| name: ${{ matrix.asset }} | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| include: | ||
| # Asset names follow `uname -s`/`uname -m` so the README's | ||
| # curl .../imcp-$(uname -s)-$(uname -m).tar.gz | ||
| # one-liner resolves to the right file on each platform. | ||
| - os: ubuntu-22.04 | ||
| target: x86_64-unknown-linux-gnu | ||
| asset: imcp-Linux-x86_64 | ||
| - os: ubuntu-22.04-arm | ||
| target: aarch64-unknown-linux-gnu | ||
| asset: imcp-Linux-aarch64 | ||
| - os: macos-13 | ||
| target: x86_64-apple-darwin | ||
| asset: imcp-Darwin-x86_64 | ||
| - os: macos-14 | ||
| target: aarch64-apple-darwin | ||
| asset: imcp-Darwin-arm64 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3 | ||
|
|
||
| # aws-lc-sys (rustls' crypto backend) builds C with cmake/clang at compile | ||
| # time. macOS runners ship these; Linux runners need libclang explicitly. | ||
| - name: Install Linux build deps | ||
| if: runner.os == 'Linux' | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y --no-install-recommends cmake clang libclang-dev perl pkg-config | ||
|
|
||
| - name: Build release binary | ||
| shell: bash | ||
| env: | ||
| # Baked into the binary (option_env! in main.rs), surfaced at GET /version. | ||
| GIT_SHA: ${{ github.sha }} | ||
| run: | | ||
| export BUILD_TIME="$(date +%s)" | ||
| cargo build --release --locked | ||
|
|
||
| - name: Package | ||
| shell: bash | ||
| run: | | ||
| mkdir -p dist | ||
| cp target/release/mcp-poc dist/imcp | ||
| chmod +x dist/imcp | ||
| tar -C dist -czf "${{ matrix.asset }}.tar.gz" imcp | ||
| shasum -a 256 "${{ matrix.asset }}.tar.gz" > "${{ matrix.asset }}.tar.gz.sha256" | ||
|
|
||
| - name: Upload build artifact | ||
| uses: actions/upload-artifact@v4 | ||
|
aterga marked this conversation as resolved.
Outdated
|
||
| with: | ||
| name: ${{ matrix.asset }} | ||
| path: | | ||
| ${{ matrix.asset }}.tar.gz | ||
| ${{ matrix.asset }}.tar.gz.sha256 | ||
| if-no-files-found: error | ||
|
|
||
| release: | ||
| name: Publish draft release | ||
| needs: build | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Download all build artifacts | ||
| uses: actions/download-artifact@v4 | ||
|
aterga marked this conversation as resolved.
Outdated
|
||
| with: | ||
| path: artifacts | ||
| merge-multiple: true | ||
|
|
||
| - name: Create or update draft release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| GH_REPO: ${{ github.repository }} | ||
| TAG: ${{ github.ref_name }} | ||
| run: | | ||
| # Idempotent: create the draft release on first run, or just (re)upload | ||
| # the assets if the release already exists (re-run of the same tag). | ||
| gh release create "$TAG" \ | ||
| --draft \ | ||
| --title "$TAG" \ | ||
| --generate-notes \ | ||
| artifacts/*.tar.gz artifacts/*.sha256 \ | ||
| || gh release upload "$TAG" \ | ||
| artifacts/*.tar.gz artifacts/*.sha256 --clobber | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.