Skip to content
This repository was archived by the owner on Nov 3, 2026. It is now read-only.
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
22 changes: 22 additions & 0 deletions .github/workflows/auto-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,39 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref || github.ref_name }}
path: loop_cli
# Use PAT to trigger downstream workflows; fallback to GITHUB_TOKEN
token: ${{ secrets.PARENT_REPO_PAT || github.token }}

- name: Clone dependencies
run: |
git clone --depth 1 https://github.com/harmony-labs/loop_lib.git

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["loop_cli", "loop_lib"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Run cargo fmt
working-directory: loop_cli
run: cargo fmt --all

- name: Check for changes
id: changes
working-directory: loop_cli
run: |
if git diff --quiet; then
echo "formatted=false" >> $GITHUB_OUTPUT
Expand All @@ -48,6 +69,7 @@ jobs:

- name: Commit and push
if: steps.changes.outputs.formatted == 'true'
working-directory: loop_cli
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
branches: [main]
pull_request:
branches: [main]
repository_dispatch:
types: [dependency-updated]

env:
CARGO_TERM_COLOR: always
Expand All @@ -28,6 +30,21 @@ jobs:
run: |
git clone --depth 1 https://github.com/harmony-labs/loop_lib.git

- name: Create workspace Cargo.toml
shell: bash
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["loop_cli", "loop_lib"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable

Expand All @@ -53,6 +70,20 @@ jobs:
run: |
git clone --depth 1 https://github.com/harmony-labs/loop_lib.git

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["loop_cli", "loop_lib"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
Expand All @@ -73,11 +104,32 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: loop_cli

- name: Clone dependencies
run: |
git clone --depth 1 https://github.com/harmony-labs/loop_lib.git

- name: Create workspace Cargo.toml
run: |
cat > Cargo.toml << 'EOF'
[workspace]
members = ["loop_cli", "loop_lib"]
resolver = "2"

[workspace.package]
version = "0.1.0"
edition = "2021"
license = "MIT"
repository = "https://github.com/harmony-labs/meta"
EOF

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt

- name: Check formatting
working-directory: loop_cli
run: cargo fmt --all -- --check
72 changes: 72 additions & 0 deletions .github/workflows/notify-parent.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Notify Parent Repo

on:
push:
branches: [main]
repository_dispatch:
types: [dependency-updated]

jobs:
wait-for-ci:
runs-on: ubuntu-latest
steps:
- name: Wait for CI
uses: lewagon/wait-on-check-action@v1.5.0
with:
ref: ${{ github.sha }}
check-name: 'Test (ubuntu-latest)'
repo-token: ${{ secrets.GITHUB_TOKEN }}
wait-interval: 10

notify-parent:
needs: wait-for-ci
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Determine source
id: source
run: |
if [ "${{ github.event_name }}" = "repository_dispatch" ]; then
echo "repo=${{ github.event.client_payload.repo }}" >> $GITHUB_OUTPUT
echo "repo_name=${{ github.event.client_payload.repo_name }}" >> $GITHUB_OUTPUT
echo "sha=${{ github.event.client_payload.sha }}" >> $GITHUB_OUTPUT
echo "short_sha=${{ github.event.client_payload.short_sha }}" >> $GITHUB_OUTPUT
echo "message=${{ github.event.client_payload.message }}" >> $GITHUB_OUTPUT
echo "type=${{ github.event.client_payload.type }}" >> $GITHUB_OUTPUT
echo "actor=${{ github.event.client_payload.actor }}" >> $GITHUB_OUTPUT
else
MSG=$(git log -1 --pretty=%s)
echo "message=$MSG" >> $GITHUB_OUTPUT
echo "repo=${{ github.repository }}" >> $GITHUB_OUTPUT
echo "repo_name=${{ github.event.repository.name }}" >> $GITHUB_OUTPUT
echo "actor=${{ github.actor }}" >> $GITHUB_OUTPUT
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "short_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
if [[ "$MSG" =~ ^feat[:(] ]]; then echo "type=feat" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^fix[:(] ]]; then echo "type=fix" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^chore[:(] ]]; then echo "type=chore" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^docs[:(] ]]; then echo "type=docs" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^test[:(] ]]; then echo "type=test" >> $GITHUB_OUTPUT
elif [[ "$MSG" =~ ^refactor[:(] ]]; then echo "type=refactor" >> $GITHUB_OUTPUT
else echo "type=other" >> $GITHUB_OUTPUT
fi
fi

- name: Notify parent repo
uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.PARENT_REPO_PAT }}
repository: harmony-labs/meta
event-type: child-repo-updated
client-payload: >-
{
"repo": ${{ toJSON(steps.source.outputs.repo) }},
"repo_name": ${{ toJSON(steps.source.outputs.repo_name) }},
"sha": ${{ toJSON(steps.source.outputs.sha) }},
"short_sha": ${{ toJSON(steps.source.outputs.short_sha) }},
"message": ${{ toJSON(steps.source.outputs.message) }},
"type": ${{ toJSON(steps.source.outputs.type) }},
"actor": ${{ toJSON(steps.source.outputs.actor) }}
}