Skip to content

Commit

Permalink
Merge pull request #1233 from input-output-hk/cardano-node-github-wor…
Browse files Browse the repository at this point in the history
…kflow

Create a github action to build cardano-node binaries
  • Loading branch information
ch1bo authored Jan 9, 2024
2 parents a1b4e90 + 569cfa0 commit 853cd4d
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 8 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/cardano-node.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Produce distributable binaries for cardano-node 8.7.2
#
# XXX: Remove again when upstream releases them (again).
name: Cardano-node

on:
workflow_dispatch:

jobs:
build-executables-linux:
name: "Build x86_64-linux static executables"
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout cardano-node 8.7.2
uses: actions/checkout@v4
with:
repository: IntersectMBO/cardano-node
ref: 8.7.2

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Build cardano-node static executables
run: |
mkdir -p out/
nix build .#hydraJobs.x86_64-linux.musl.cardano-node
cp result/bin/* out/
nix build .#hydraJobs.x86_64-linux.musl.cardano-cli
cp result/bin/* out/
- name: 💾 Upload matching cardano-node executables
uses: actions/upload-artifact@v4
with:
name: cardano-node-x86_64-linux # automatically zips
path: out/*

build-executables-macos:
name: "Build aarch64-darwin dynamic executables"
runs-on: [self-hosted, macOS, ARM64]
steps:
- name: 📥 Checkout cardano-node 8.7.2
uses: actions/checkout@v4
with:
# 8.7.2-fork which provides a macos flake output
repository: ch1bo/cardano-node
ref: 170817f5ba3f7838ffd9bd181bc30504906a6506

- name: ❄ Prepare nix
uses: cachix/install-nix-action@v23
with:
extra_nix_config: |
accept-flake-config = true
log-lines = 1000
- name: ❄ Build executables
run: |
mkdir -p out
nix build .#hydraJobs.aarch64-darwin.native.cardano-node-macos
tar -C out -xzvf result/cardano-node-*-macos.tar.gz cardano-node cardano-cli '*.dylib'
# NOTE: github strips permissions so setting chmod +x here does not help
- name: 💾 Upload executables
uses: actions/upload-artifact@v4
with:
name: cardano-node-aarch64-darwin # automatically zips
path: out/*
2 changes: 1 addition & 1 deletion .github/workflows/check-tutorial.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
import re
with open("docs/docs/tutorial/index.md", "r") as tutorial:
body = tutorial.read()
usedCardanoNodeVersions = re.findall(r"cardano-node/releases/download/([0-9]+\.[0-9]+\.[0-9]+)", body)
usedCardanoNodeVersions = re.findall(r"cardano-node-.*-([0-9]+\.[0-9]+\.[0-9]+).zip", body)
with open("hydra-cluster/test/Test/CardanoNodeSpec.hs", "r") as cardanoNodeSpecFile:
body = cardanoNodeSpecFile.read()
Expand Down
4 changes: 3 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ To perform a release of next `<version>`:
push the branches `master`, `release` and the `<version>` tag.
5. Create a github release page containing
* The released changes (formatted) and giving credit where credit is due
* Attach static binaries to the release (or link the CI artifact)
* Built hydra (and cardano-node) binaries to the release using naming scheme:
`hydra-<platform>-<version>.zip` where `platform` is `x86_64-linux` or
`aarch64-darwin` (the same for `cardano-node` instead of `hydra`)
* The just published `hydra-scripts-tx-id` from step 1

[smoke-test]: https://github.com/input-output-hk/hydra/actions/workflows/smoke-test.yaml
Expand Down
12 changes: 6 additions & 6 deletions docs/docs/tutorial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ mkdir -p bin
version=0.14.0
curl -L -O https://github.com/input-output-hk/hydra/releases/download/${version}/hydra-x86_64-linux-${version}.zip
unzip -d bin hydra-x86_64-linux-${version}.zip
curl -L -o - https://github.com/input-output-hk/cardano-node/releases/download/8.7.2/cardano-node-8.7.2-linux.tar.gz \
| tar xz -C bin ./cardano-node ./cardano-cli
curl -L -o - https://github.com/input-output-hk/hydra/releases/download/${version}/cardano-node-x86_64-linux-8.7.2.zip
unzip -d bin cardano-node-8.7.2-linux.zip
curl -L -o - https://github.com/input-output-hk/mithril/releases/download/2347.0/mithril-2347.0-linux-x64.tar.gz \
| tar xz -C bin mithril-client
chmod +x bin/*
Expand All @@ -58,12 +58,12 @@ chmod +x bin/*
mkdir -p bin
version=0.14.0
curl -L -O https://github.com/input-output-hk/hydra/releases/download/${version}/hydra-aarch64-darwin-${version}.zip
unzip -d bin hydra-aarch64-darwin-${HYDRA_VERSION}.zip
unzip -d bin hydra-aarch64-darwin-${version}.zip
curl -L -o - https://github.com/input-output-hk/hydra/releases/download/${version}/cardano-node-aarch-darwin-8.7.2.zip
unzip -d bin cardano-node-8.7.2-linux.zip
curl -L -o - https://github.com/input-output-hk/mithril/releases/download/2347.0/mithril-2347.0-macos-x64.tar.gz \
| tar xz -C bin
curl -L -o - https://github.com/input-output-hk/cardano-node/releases/download/8.7.2/cardano-node-8.7.2-macos.tar.gz \
| tar xz -C bin cardano-node cardano-cli '*.dylib'
chmod +x bin/mithril-client
chmod +x bin/*
```

</TabItem>
Expand Down

0 comments on commit 853cd4d

Please sign in to comment.