Skip to content

Commit

Permalink
More changes to build.sh and release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Nov 14, 2023
1 parent ed990d5 commit 94ef1e7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 21 deletions.
22 changes: 12 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ jobs:
- name: Build ${{ matrix.arch }}
run: |
./build.sh -v $VER -a ${{ matrix.arch }}
file build/linux/*/*/$APP
- name: Build ${{ matrix.arch }} (static)
if: matrix.arch != 'arm'
run: |
./build.sh -v $VER -a ${{ matrix.arch }} -s
file build/linux/*/*/${APP}_static
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -59,7 +57,8 @@ jobs:
arch: [amd64, arm64]
steps:
- name: Install build dependencies
run: brew install coreutils
run: |
brew install coreutils gnu-tar
- name: Checkout
uses: actions/checkout@v3
- name: Setup Go
Expand All @@ -69,7 +68,6 @@ jobs:
- name: Build ${{ matrix.arch }}
run: |
./build.sh -v $VER -a ${{ matrix.arch }}
file build/darwin/*/*/$APP
- name: Archive artifacts
uses: actions/upload-artifact@v3
with:
Expand All @@ -84,19 +82,20 @@ jobs:
runs-on: macos-latest
steps:
- name: Install build dependencies
run: brew install coreutils
run: |
brew install coreutils gnu-tar
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Build universal
run: |
export WORKDIR=$PWD/build/darwin/universal/$VER
mkdir -p $WORKDIR
tar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR $APP
tar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR LICENSE
gtar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR $APP
gtar -jxvf dist-darwin-amd64/*/*/*.tar.bz2 -C $WORKDIR LICENSE
mv $WORKDIR/$APP $WORKDIR/$APP-amd64
tar -jxvf dist-darwin-arm64/*/*/*.tar.bz2 -C $WORKDIR $APP
gtar -jxvf dist-darwin-arm64/*/*/*.tar.bz2 -C $WORKDIR $APP
mv $WORKDIR/$APP $WORKDIR/$APP-arm64
file $WORKDIR/$APP-{amd64,arm64}
Expand All @@ -107,7 +106,9 @@ jobs:
rm $WORKDIR/$APP-{amd64,arm64}
tar -C $WORKDIR -cjf $WORKDIR/$APP-${VER#v}-darwin-universal.tar.bz2 $APP LICENSE
sudo /usr/sbin/purge
gtar -C $WORKDIR -cjf $WORKDIR/$APP-${VER#v}-darwin-universal.tar.bz2 $APP LICENSE
ls -alh $WORKDIR/*
sha256sum $WORKDIR/*
- name: Archive artifacts
Expand All @@ -131,7 +132,8 @@ jobs:
# go-version: ${{ env.GO_VERSION }}
# - name: Build amd64
# shell: bash
# run: ./build.sh -v $VER
# run: |
# ./build.sh -v $VER
# - name: Archive artifacts
# uses: actions/upload-artifact@v3
# with:
Expand Down
27 changes: 16 additions & 11 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,22 @@ if [[ "$INSTALL" == "1" || "$BUILDONLY" == "1" ]]; then
exit
fi

(set -x;
file $BIN
)
if [[ "$PLATFORM" != "windows" ]]; then
(set -x;
chmod +x $BIN
)
fi

# purge disk cache
if [[ "$PLATFORM" == "darwin" && "$CI" == "true" ]]; then
(set -x;
sudo /usr/sbin/purge
)
fi

built_ver() {
if [[ "$PLATFORM" == "linux" && "$ARCH" != "$GOARCH" ]]; then
EXTRA=
Expand Down Expand Up @@ -217,17 +233,6 @@ if [[ "$CHECK" == "1" ]]; then
echo "REPORTED: $BUILT_VER"
fi

(set -x;
file $BIN
)

# purge disk cache
if [[ "$PLATFORM" == "darwin" && "$CI" == "true" ]]; then
(set -x;
sudo /usr/sbin/purge
)
fi

# pack
cp $SRC/LICENSE $DIR
case $EXT in
Expand Down

0 comments on commit 94ef1e7

Please sign in to comment.