Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
update workflow to sync versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
dpaiton committed Apr 29, 2024
1 parent 14fb186 commit 35aabef
Show file tree
Hide file tree
Showing 6 changed files with 112 additions and 25 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/build_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,20 @@ jobs:
with:
version: nightly

- name: Check out hyperdrive-rs
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive-rs
ref: "v0.1.0"
path: "./hyperdrive-rs"

- name: check out hyperdrive
uses: actions/checkout@master
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive
ref: "v1.0.3"
path: "./hyperdrive"
path: "./hyperdrive-rs/hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}

- name: build hyperdrive-wasm
working-directory: crates/hyperdrive-wasm
Expand Down
54 changes: 45 additions & 9 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ jobs:
name: build on linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout hyperdrive-bindings
uses: actions/checkout@v4
with:
token: ${{github.token}}

Expand All @@ -46,19 +47,33 @@ jobs:
- name: set up pip
run: python -m pip install --upgrade pip

- name: check out hyperdrive-rs
- name: Fetch latest release tag from hyperdrive
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest release tag from hyperdrive-rs
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive-rs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check out hyperdrive-rs
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive-rs
ref: "v1.0.1"
ref: ${{ env.latest_tag_hyperdrive-rs }}
path: "./hyperdrive-rs"

- name: check out hyperdrive
uses: actions/checkout@master
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive
ref: "v1.0.3"
ref: ${{ env.latest_tag_hyperdrive }}
path: "./hyperdrive-rs/hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}

- name: build hyperdrive
run: cd hyperdrive-rs/hyperdrive && make build-sol

- name: build hyperdrivepy
shell: bash
Expand All @@ -83,19 +98,40 @@ jobs:
python-version: [cp310]

steps:
- uses: actions/checkout@v3
- name: Checkout hyperdrive-bindings
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest release tag from hyperdrive
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest release tag from hyperdrive-rs
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive-rs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check out hyperdrive-rs
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive-rs
ref: ${{ env.latest_tag_hyperdrive-rs }}
path: "./hyperdrive-rs"

- name: check out hyperdrive
uses: actions/checkout@master
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive
ref: "v1.0.3"
path: "./hyperdrive"
ref: ${{ env.latest_tag_hyperdrive }}
path: "./hyperdrive-rs/hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}

- name: build hyperdrive
run: cd hyperdrive-rs/hyperdrive && make build-sol

- name: set up python
uses: actions/setup-python@v4
with:
Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,40 @@ jobs:
name: python lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout hyperdrive-bindings
uses: actions/checkout@v4
with:
submodules: recursive
token: ${{ secrets.GITHUB_TOKEN }}

# NOTE: This is needed to ensure that hyperdrive-wrappers builds correctly.
- name: install foundry
- name: Install foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: check out hyperdrive-rs
- name: Fetch latest release tag from hyperdrive
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest release tag from hyperdrive-rs
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive-rs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check out hyperdrive-rs
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive-rs
ref: "v1.0.3"
ref: ${{ env.latest_tag_hyperdrive-rs }}
path: "./hyperdrive-rs"

- name: check out hyperdrive
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive
ref: "v1.0.3"
ref: ${{ env.latest_tag_hyperdrive }}
path: "./hyperdrive-rs/hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}

Expand Down
21 changes: 16 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,30 @@ jobs:
with:
version: nightly

- name: check out hyperdrive-rs
uses: actions/checkout@v3
- name: Fetch latest release tag from hyperdrive
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fetch latest release tag from hyperdrive-rs
run: ./scripts/fetch-latest-tag.sh delvtech hyperdrive-rs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Check out hyperdrive-rs
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive-rs
ref: "v1.0.3"
ref: ${{ env.latest_tag_hyperdrive-rs }}
path: "./hyperdrive-rs"

- name: check out hyperdrive
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: delvtech/hyperdrive
ref: "v1.0.3"
ref: ${{ env.latest_tag_hyperdrive }}
path: "./hyperdrive-rs/hyperdrive"
ssh-key: ${{ secrets.HYPERDRIVE_ACCESS_KEY }}

- name: build hyperdrive
run: cd hyperdrive-rs/hyperdrive && make build-sol
Expand Down
8 changes: 4 additions & 4 deletions crates/hyperdrive-wasm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ wasm-bindgen-futures = "0.4.36"
wasm-bindgen = { version = "0.2.86", features = ["serde-serialize"] }
hex = { package = "const-hex", version = "1.6", features = ["hex"] }

fixed-point = { version = "0.1.0", path = "../../hyperdrive/crates/fixed-point" }
fixed-point-macros = { version = "0.1.0", path = "../../hyperdrive/crates/fixed-point-macros" }
hyperdrive-math = { version = "0.1.0", path = "../../hyperdrive/crates/hyperdrive-math" }
hyperdrive-wrappers = { version = "0.1.0", path = "../../hyperdrive/crates/hyperdrive-wrappers" }
fixed-point = { version = "0.1.0", path = "../../hyperdrive-rs/hyperdrive/crates/fixed-point" }
fixed-point-macros = { version = "0.1.0", path = "../../hyperdrive-rs/hyperdrive/crates/fixed-point-macros" }
hyperdrive-math = { version = "0.1.0", path = "../../hyperdrive-rs/hyperdrive/crates/hyperdrive-math" }
hyperdrive-wrappers = { version = "0.1.0", path = "../../hyperdrive-rs/hyperdrive/crates/hyperdrive-wrappers" }

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
Expand Down
21 changes: 21 additions & 0 deletions scripts/fetch-latest-tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# GitHub organization
ORG=$1

# GitHub repository name
REPO=$2

# GitHub Token provided by GitHub Actions
TOKEN=${GITHUB_TOKEN}

# Fetch all tags from the repository
TAG=$(curl -sH "Authorization: token $TOKEN" "https://api.github.com/repos/$ORG/$REPO/releases/latest" | jq -r '.tag_name')

# Sanitize repository name to create a valid environment variable name
# Replace '/' with '_' and convert to lower case
ENV_REPO_NAME=$(echo "$REPO" | tr '/' '_' | tr '[:upper:]' '[:lower:]')

# Output the tag for subsequent steps
# echo "latest_tag_${ENV_REPO_NAME}=$TAG" >> $GITHUB_ENV
echo "latest_tag_${ENV_REPO_NAME}=$TAG"

0 comments on commit 35aabef

Please sign in to comment.