wstunnel/.goreleaser_hook.sh
Σrebe - Romain GERARD 8c6ea78c95 update github action
Former-commit-id: 6ff4e58449ddf3187c01192197205eada2fc39dc [formerly 67915963dc5c453e6fa56b7b53ec3dedd5c1c507] [formerly 58f51cf90afefb77dbaa7dab472773f0d8cd6230 [formerly 701e6058f04724ccb99101fb905b2d18555a4b02]]
Former-commit-id: 8d302ab962f0db880d7f7615c70989a46e8e9784 [formerly 209f5188eb70acc5aab145b610948bd692f99ca0]
Former-commit-id: 0f52ba48e98a394e5d5fbcc62bede5862b5ac6a5
Former-commit-id: c5da80082c6f8a791db53aa6a285a4399240ba65
Former-commit-id: f439cc8f1274622347820678716cf2e96b823ee9
Former-commit-id: 469547faafed849f2748a8ae5b7ecf5978339e8b [formerly 213a1494327df8ae98b4fcec99d0132f51936e84]
Former-commit-id: 4851ae072a8df1c96fcf6a9692afa52bb5492c14
2023-10-21 22:43:49 +02:00

27 lines
723 B
Bash
Executable file

#!/usr/bin/env bash
go_arch=$1
go_os=$2
project_name=$3
# Make Go -> Rust arch/os mapping
case $go_arch in
amd64) rust_arch='x86_64' ;;
arm64) rust_arch='aarch64' ;;
arm) rust_arch='armv7' ;;
*) echo "unknown arch: $go_arch" && exit 1 ;;
esac
case $go_os in
linux) rust_os='linux' ;;
darwin) rust_os='apple-darwin' ;;
windows) rust_os='windows' ;;
*) echo "unknown os: $go_os" && exit 1 ;;
esac
# Find artifacts and uncompress in the coresponding directory
DIST_DIR=$(find dist -type d -name "*${go_os}_${go_arch}*")
echo "DIST_DIR: $DIST_DIR"
rm -f ${DIST_DIR}/${project_name}*
find artifacts -type f -wholename "*${rust_arch}*${rust_os}*/${project_name}*" -exec cp {} ${DIST_DIR}/ \;