chore: add install dependencies #15
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: ${{ matrix.os }} | |
strategy: | |
matrix: | |
include: | |
- build: linux | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-gnu | |
- build: linux | |
os: ubuntu-latest | |
target: x86_64-unknown-linux-musl | |
- build: linux | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-gnu | |
- build: linux | |
os: ubuntu-latest | |
target: aarch64-unknown-linux-musl | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- 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 dependencies | |
shell: bash | |
run: | | |
sudo apt-get update | |
sudo apt-get install pkg-config libssl-dev libclang-dev protobuf-compiler | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: true | |
command: build | |
args: --verbose --release --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 "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 "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 "ASSET=$dirname.tar.gz" >> $GITHUB_ENV | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
generate_release_notes: true | |
files: | | |
${{ env.ASSET }} | |
# publish-crates: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v3 | |
# - name: Install Rust | |
# uses: dtolnay/rust-toolchain@stable | |
# - name: Install dependencies | |
# shell: bash | |
# run: | | |
# sudo apt-get update | |
# sudo apt-get install -y openssl libclang-dev pkg-config protobuf-compiler libssl-dev | |
# - uses: katyo/publish-crates@v2 | |
# with: | |
# registry-token: ${{ secrets.CARGO_REGISTRY_TOKEN }} |