source archive #2
This file contains 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
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: Get version | |
run: echo "WORKER_VERSION=$(cargo metadata --no-deps --format-version=1 | jq '.packages[].version' -r)" >> $GITHUB_ENV | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
path: origin | |
- 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 |