-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathrelease.sh
executable file
·25 lines (19 loc) · 942 Bytes
/
release.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
set -e
# Ask for RELEASE_NAME
read -p "Enter RELEASE_NAME: " RELEASE_NAME
# Create releases directory if it doesn't exist
mkdir -p "releases/${RELEASE_NAME}"
# Read targets from .targets file and build
if [ -f .targets ]; then
cat .targets | xargs -I {} rustup target add {}
cat .targets | xargs -I {} cargo zigbuild --target {} --release -Z unstable-options --out-dir="./releases/${RELEASE_NAME}/{}" || true
echo "Build completed. Output files are in releases/${RELEASE_NAME}/ directory."
# Create tar.gz archive excluding files specified in .gitignore
git archive --format=tar.gz --output="releases/${RELEASE_NAME}/src.tar.gz" HEAD
# Create zip archive excluding files specified in .gitignore
git archive --format=zip --output="releases/${RELEASE_NAME}/src.zip" HEAD
echo "Tar.gz and Zip archives created in releases/${RELEASE_NAME}/ directory."
else
echo ".targets file not found."
fi