Skip to content

Merge pull request #6 from UndyingSoul/dependabot/cargo/rustix-0.38.21 #9

Merge pull request #6 from UndyingSoul/dependabot/cargo/rustix-0.38.21

Merge pull request #6 from UndyingSoul/dependabot/cargo/rustix-0.38.21 #9

Workflow file for this run

name: LDOT Project
on:
push:
tags:
- 'v*.*.*'
permissions:
contents: write
jobs:
test:
name: Release - ${{ matrix.platform.release_for }}
strategy:
matrix:
platform:
- release_for: Linux-x86_64
os: ubuntu-20.04
target: x86_64-unknown-linux-gnu
bin: ldot
name: ldot-Linux-x86_64.tar.gz
command: build
# - release_for: Linux-aarch64
# os: ubuntu-20.04
# target: aarch64-unknown-linux-gnu
# bin: ldot
# name: ldot-Linux-aarch64.tar.gz
# command: build
- release_for: Windows-x86_64
os: windows-latest
target: x86_64-pc-windows-msvc
bin: ldot.exe
name: ldot-Windows-x86_64.zip
command: both
- release_for: macOS-x86_64
os: macOS-latest
target: x86_64-apple-darwin
bin: ldot
name: ldot-Darwin-x86_64.tar.gz
command: both
# - release_for: macOS-aarch64
# os: macOS-latest
# target: aarch64-apple-darwin
# bin: ldot
# name: ldot-Darwin-aarch64.tar.gz
# command: both
runs-on: ${{ matrix.platform.os }}
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: ${{ matrix.platform.command }}
target: ${{ matrix.platform.target }}
args: "--locked --release"
strip: true
- name: Build archive
shell: bash
run: |
# Replace with the name of your binary
binary_name="ldot"
dirname="$binary_name-${{ matrix.platform.target }}"
mkdir "$dirname"
if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then
mv "target/${{ matrix.platform.target }}/release/$binary_name.exe" "$dirname"
else
mv "target/${{ matrix.platform.target }}/release/$binary_name" "$dirname"
fi
if [ "${{ matrix.platform.os }}" = "windows-latest" ]; then
7z a "$dirname.zip" "$dirname"
echo "ASSET=$dirname.zip" >> $GITHUB_ENV
else
tar -czf "$dirname.tar.gz" "$dirname"
echo "ASSET=$dirname.tar.gz" >> $GITHUB_ENV
fi
- name: Upload the binaries
uses: softprops/action-gh-release@v1
with:
files: |
${{ env.ASSET }}