source archive #6
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 | |
env: | |
CI: true | |
jobs: | |
publish: | |
name: Build and publish source archive | |
runs-on: ubunutu-latest | |
# runs-on: [self-hosted, dev-server] | |
steps: | |
- name: Load ssh key to fetch private dependencies | |
uses: webfactory/ssh-agent@v0.9.0 | |
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 | |
- name: Get version | |
working-directory: origin | |
env: | |
CARGO_NET_GIT_FETCH_WITH_CLI: true | |
run: echo "WORKER_VERSION=$(cargo metadata --no-deps --format-version=1 | jq '.packages[].version' -r)" >> $GITHUB_ENV | |
- name: Create archive | |
run: | | |
cargo fetch | |
cargo vendor | |
BUILD=$(mktemp -d)/worker-rs | |
mkdir -pv $BUILD | |
mkdir $BUILD/.cargo | |
mkdir $BUILD/vendor | |
cp -rv Cargo.toml Cargo.lock src benches $BUILD | |
cp .env.testnet $BUILD/.env | |
cp .vendor-config.toml $BUILD/.cargo/config.toml | |
cp -rv vendor/{contract-client,subsquid-*} $BUILD/vendor | |
tar --owner=root --group=root -czf worker-${{ env.WORKER_VERSION }}.tar.gz $BUILD | |
rm -r $BUILD | |
shell: bash | |
- name: Publish release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: worker-${{ env.WORKER_VERSION }}.tar.gz |