0.7.2 #59
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
on: | |
release: | |
types: | |
- created | |
name: Upload Release Assets | |
jobs: | |
assets: | |
name: Upload Release Assets | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, macOS-latest ] | |
include: | |
- os: ubuntu-latest | |
name: linux | |
- os: macOS-latest | |
name: macos | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Extract version tag | |
id: version | |
run: echo ::set-output name=value::$(echo ${{ github.ref }} | cut -f 3 -d / ) | |
- name: Build cargo-dinghy | |
run: | | |
set -ex | |
ZIPDIR=cargo-dinghy-${{ steps.version.outputs.value }} | |
mkdir $ZIPDIR | |
if [ ${{matrix.name}} == "macos" ] | |
then | |
# Let's ensure that both aarch64 and x86_64 targets are installed | |
rustup target add aarch64-apple-darwin x86_64-apple-darwin | |
brew install coreutils gnu-tar | |
PATH=$(brew --prefix)/opt/coreutils/libexec/gnubin:$PATH | |
PATH=$(brew --prefix)/opt/gnu-tar/libexec/gnubin:$PATH | |
tar --version | |
cargo build --target aarch64-apple-darwin --target x86_64-apple-darwin --release -p cargo-dinghy | |
lipo -create -output $ZIPDIR/cargo-dinghy target/aarch64-apple-darwin/release/cargo-dinghy target/x86_64-apple-darwin/release/cargo-dinghy | |
else | |
./musl_build.sh | |
mv target/cargo-dinghy $ZIPDIR | |
fi | |
ls -al $ZIPDIR | |
$ZIPDIR/cargo-dinghy --version | |
file $ZIPDIR/cargo-dinghy | |
md5sum $ZIPDIR/cargo-dinghy | |
tar vczf cargo-dinghy-${{matrix.name}}-${{ steps.version.outputs.value }}.tgz $ZIPDIR | |
md5sum cargo-dinghy-${{matrix.name}}-${{ steps.version.outputs.value }}.tgz | |
mkdir test | |
cd test | |
tar zxf ../cargo-dinghy-${{matrix.name}}-${{ steps.version.outputs.value }}.tgz | |
md5sum $ZIPDIR/cargo-dinghy | |
- name: Upload asset | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: cargo-dinghy-${{matrix.name}}-${{ steps.version.outputs.value }}.tgz | |
name: ${{ steps.version.outputs.value }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |