Skip to content

Commit

Permalink
Add github workflow to build sources archive
Browse files Browse the repository at this point in the history
  • Loading branch information
kalabukdima committed May 14, 2024
1 parent 281b2c9 commit 964f995
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .env.testnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export RUST_LOG=info
export SENTRY_DSN=https://[email protected]/4507056936779776
export SCHEDULER_ID=12D3KooWQER7HEpwsvqSzqzaiV36d3Bn6DZrnwEunnzS76pgZkMU
export LOGS_COLLECTOR_ID=12D3KooWC3GvQVqnvPwWz23sTW8G8HVokMnox62A7mnL9wwaSujk
export P2P_LISTEN_ADDRS=/ip4/0.0.0.0/udp/12345/quic-v1
export BOOT_NODES="12D3KooWSRvKpvNbsrGbLXGFZV7GYdcrYNh4W2nipwHHMYikzV58 /dns4/testnet.subsquid.io/udp/22445/quic-v1,12D3KooWQC9tPzj2ShLn39RFHS5SGbvbP2pEd7bJ61kSW2LwxGSB /dns4/testnet.subsquid.io/udp/22446/quic-v1"
export RPC_URL=https://sepolia-rollup.arbitrum.io/rpc
export L1_RPC_URL=https://rpc.sepolia.org
export GATEWAY_REGISTRY_CONTRACT_ADDR=0xAB46F688AbA4FcD1920F21E9BD16B229316D8b0a
export WORKER_REGISTRATION_CONTRACT_ADDR=0xCD8e983F8c4202B0085825Cf21833927D1e2b6Dc
export NETWORK_CONTROLLER_CONTRACT_ADDR=0x68Fc7E375945d8C8dFb0050c337Ff09E962D976D
export ALLOCATIONS_VIEWER_CONTRACT_ADDR=0xC0Af6432947db51e0C179050dAF801F19d40D2B7
52 changes: 52 additions & 0 deletions .github/workflows/sources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: source archive
on:
workflow_dispatch: # manually run
inputs:

env:
CI: true

jobs:
publish:
name: Build and publish source archive
runs-on: [self-hosted, dev-server]
steps:
- name: Load ssh key to fetch private dependencies
uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.NETWORK_SSH_KEY }}

- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable

- name: Checkout
uses: actions/checkout@v4
with:
path: origin

- name: Get version
working-directory: origin
run: echo "WORKER_VERSION=$(cargo metadata --no-deps --format-version=1 | jq '.packages[].version' -r)" >> $GITHUB_ENV

- name: Create archive
run: |
mkdir worker-rs
mkdir worker-rs/.cargo
cp -rv origin/{Cargo.toml,Cargo.lock,src,benches} worker-rs
cp origin/.env.testnet worker-rs/.env
cp origin/.vendor-config.toml worker-rs/.cargo/config.toml
cd worker-rs
cargo vendor tmp
mkdir vendor
cp -rv tmp/{contract-client,subsquid-*} vendor
rm -r tmp
cd ..
tar --owner=root --group=root -czf worker-${{ env.WORKER_VERSION }}.tar.gz worker-rs
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: worker-${{ env.WORKER_VERSION }}.tar.gz
10 changes: 10 additions & 0 deletions .vendor-config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[source."git+ssh://git@github.com/subsquid/archive-router.git"]
git = "ssh://[email protected]/subsquid/archive-router.git"
replace-with = "vendored-sources"

[source."git+ssh://git@github.com/subsquid/subsquid-network.git"]
git = "ssh://[email protected]/subsquid/subsquid-network.git"
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

0 comments on commit 964f995

Please sign in to comment.