feat: add prefetch log for downloading (#536) #142
Workflow file for this run
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: Release | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
release-github: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-unknown-linux-musl | |
- aarch64-unknown-linux-gnu | |
- aarch64-unknown-linux-musl | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- uses: Swatinem/rust-cache@v2 | |
with: | |
key: ${{ matrix.target }} | |
cache-on-failure: true | |
- name: Get the release version from the tag | |
shell: bash | |
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- name: Install cross-compilation tools | |
uses: taiki-e/setup-cross-toolchain-action@v1 | |
with: | |
target: ${{ matrix.target }} | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install protobuf-compiler libclang-dev | |
- name: Build binaries | |
shell: bash | |
run: | | |
cargo build --release --bins --target ${{ matrix.target }} | |
- name: Build archive dfget | |
shell: bash | |
run: | | |
binary_name="dfget" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "DFGET_ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Build archive dfdaemon | |
shell: bash | |
run: | | |
binary_name="dfdaemon" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "DFDAEMON_ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Build archive dfstore | |
shell: bash | |
run: | | |
binary_name="dfstore" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "DFSTORE_ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Build archive dfinit | |
shell: bash | |
run: | | |
binary_name="dfinit" | |
dirname="$binary_name-${{ env.VERSION }}-${{ matrix.target }}" | |
mv "target/${{ matrix.target }}/release/$binary_name" "$dirname" | |
tar -czf "$dirname.tar.gz" "$dirname" | |
echo "DFSTORE_ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
draft: true | |
files: | | |
${{ env.DFGET_ASSET }} | |
${{ env.DFDAEMON_ASSET }} | |
${{ env.DFSTORE_ASSET }} | |
publish-crates: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Free Disk Space (Ubuntu) | |
uses: jlumbroso/free-disk-space@main | |
with: | |
tool-cache: false | |
android: true | |
dotnet: true | |
haskell: true | |
large-packages: true | |
docker-images: true | |
swap-storage: true | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Rust | |
uses: dtolnay/rust-toolchain@stable | |
- name: Install dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install protobuf-compiler libclang-dev | |
- uses: katyo/publish-crates@v2 | |
with: | |
registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
ignore-unpublished-changes: true |