Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
  • Loading branch information
thezzisu committed Dec 11, 2023
1 parent 02aaee4 commit 4db9371
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build

on:
push:
branches: [master]
branches: [main]
paths:
- "**/*.go"

Expand Down
44 changes: 22 additions & 22 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
#!/bin/bash

BUILD_DIR=$(dirname "$0")/build/releases
rm -rf $BUILD_DIR
mkdir -p $BUILD_DIR
cd $BUILD_DIR

sum="sha256sum"
VERSION=$(git describe --tags --always --dirty)

# AMD64
# AMD64
OSES=(linux darwin windows freebsd)
for os in ${OSES[@]}; do
suffix=""
if [ "$os" == "windows" ]
then
suffix=".exe"
fi
env GOOS=$os GOARCH=amd64 go build -o azukiiro_${os}_amd64${suffix} github.com/zhzxdev/azukiiro
tar -zcf azukiiro-${os}-amd64-$VERSION.tar.gz azukiiro_${os}_amd64${suffix}
rm azukiiro_${os}_amd64${suffix}
HASH=$($sum azukiiro-${os}-amd64-$VERSION.tar.gz)
echo "$HASH azukiiro-${os}-amd64-$VERSION.tar.gz" > azukiiro-$VERSION.sha256
env GOOS=$os GOARCH=amd64 go build -o $BUILD_DIR/azukiiro_${os}_amd64${suffix}
tar -zcf $BUILD_DIR/azukiiro-${os}-amd64-$VERSION.tar.gz $BUILD_DIR/azukiiro_${os}_amd64${suffix}
rm $BUILD_DIR/azukiiro_${os}_amd64${suffix}
HASH=$($sum $BUILD_DIR/azukiiro-${os}-amd64-$VERSION.tar.gz)
echo "$HASH" >> $BUILD_DIR/azukiiro-$VERSION.sha256
done

# 386
Expand All @@ -30,21 +30,21 @@ for os in ${OSES[@]}; do
then
suffix=".exe"
fi
env GOOS=$os GOARCH=386 go build -o azukiiro_${os}_386${suffix} github.com/zhzxdev/azukiiro
tar -zcf azukiiro-${os}-386-$VERSION.tar.gz azukiiro_${os}_386${suffix}
rm azukiiro_${os}_386${suffix}
HASH=$($sum azukiiro-${os}-386-$VERSION.tar.gz)
echo "$HASH azukiiro-${os}-386-$VERSION.tar.gz" > azukiiro-$VERSION.sha256
env GOOS=$os GOARCH=386 go build -o $BUILD_DIR/azukiiro_${os}_386${suffix}
tar -zcf $BUILD_DIR/azukiiro-${os}-386-$VERSION.tar.gz $BUILD_DIR/azukiiro_${os}_386${suffix}
rm $BUILD_DIR/azukiiro_${os}_386${suffix}
HASH=$($sum $BUILD_DIR/azukiiro-${os}-386-$VERSION.tar.gz)
echo "$HASH" >> $BUILD_DIR/azukiiro-$VERSION.sha256
done

# ARM
ARMS=(5 6 7)
for v in ${ARMS[@]}; do
env GOOS=linux GOARCH=arm GOARM=$v go build -o azukiiro_linux_arm$v github.com/zhzxdev/azukiiro
tar -zcf azukiiro-linux-arm$v-$VERSION.tar.gz azukiiro_linux_arm$v
rm azukiiro_linux_arm$v
HASH=$($sum azukiiro-linux-arm$v-$VERSION.tar.gz)
echo "$HASH azukiiro-linux-arm$v-$VERSION.tar.gz" > azukiiro-$VERSION.sha256
env GOOS=linux GOARCH=arm GOARM=$v go build -o $BUILD_DIR/azukiiro_linux_arm$v
tar -zcf $BUILD_DIR/azukiiro-linux-arm$v-$VERSION.tar.gz $BUILD_DIR/azukiiro_linux_arm$v
rm $BUILD_DIR/azukiiro_linux_arm$v
HASH=$($sum $BUILD_DIR/azukiiro-linux-arm$v-$VERSION.tar.gz)
echo "$HASH" >> $BUILD_DIR/azukiiro-$VERSION.sha256
done

# ARM64
Expand All @@ -55,9 +55,9 @@ for os in ${OSES[@]}; do
then
suffix=".exe"
fi
env GOOS=$os GOARCH=arm64 go build -o azukiiro_${os}_arm64${suffix} github.com/zhzxdev/azukiiro
tar -zcf azukiiro-${os}-arm64-$VERSION.tar.gz azukiiro_${os}_arm64${suffix}
rm azukiiro_${os}_arm64${suffix}
HASH=$($sum azukiiro-${os}-arm64-$VERSION.tar.gz)
echo "$HASH azukiiro-${os}-arm64-$VERSION.tar.gz" > azukiiro-$VERSION.sha256
env GOOS=$os GOARCH=arm64 go build -o $BUILD_DIR/azukiiro_${os}_arm64${suffix}
tar -zcf $BUILD_DIR/azukiiro-${os}-arm64-$VERSION.tar.gz $BUILD_DIR/azukiiro_${os}_arm64${suffix}
rm $BUILD_DIR/azukiiro_${os}_arm64${suffix}
HASH=$($sum $BUILD_DIR/azukiiro-${os}-arm64-$VERSION.tar.gz)
echo "$HASH" >> $BUILD_DIR/azukiiro-$VERSION.sha256
done

0 comments on commit 4db9371

Please sign in to comment.