Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
wangl-cc committed Aug 30, 2023
1 parent 1bfcc89 commit 6a1e800
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,13 @@ jobs:
run: |
$CARGO_CMD build --release --locked --package maa-cli
cd "target/$CARGO_BUILD_TARGET/release"
version=${{ needs.version.outputs.version }}
tarball="maa_cli-v$version-$CARGO_BUILD_TARGET.tar"
tarball="$CARGO_BUILD_TARGET.tar"
tar -cvf $tarball maa
echo "file_path=$PWD/$tarball" >> $GITHUB_OUTPUT
- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: maa_cli-v${{ needs.version.outputs.version }}-${{ env.CARGO_BUILD_TARGET }}.tar
name: maa_cli-${{ env.CARGO_BUILD_TARGET }}
path: ${{ steps.build.outputs.file_path }}
retention-days: 1

Expand All @@ -100,14 +99,14 @@ jobs:
id: build
run: |
ls -la
version=${{ needs.version.outputs.version }}
for arch in x86_64 aarch64; do
target="$arch-apple-darwin"
tarball="maa_cli-v$version-$target.tar"
mkdir "$target" && tar -xvf "maa_cli-v$version-$target.tar" -C "$target"
dir="maa_cli-$target"
ls -al $dir
tar -xvf "$dir/$target.tar" -C "$dir"
done
target="universal-apple-darwin"
lipo -create -output maa x86_64-apple-darwin/maa aarch64-apple-darwin/maa
lipo -create -output maa maa_cli-x86_64-apple-darwin/maa maa_cli-aarch64-apple-darwin/maa
tarball="maa_cli-v$version-$target.tar"
tar -cvf $tarball maa
echo "file_path=$PWD/$archive_name" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -143,13 +142,14 @@ jobs:
run: |
version=${{ needs.version.outputs.version }}
for target in x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu universal-apple-darwin; do
mkdir "$target" && tar -xvf "maa_cli-v$version-$target.tar" -C "$target"
dir="maa_cli-$target"
tar -xvf "$dir/$target.tar" -C "$dir"
if [ "$target" == "universal-apple-darwin" ]; then
archive_name="maa_cli-v$version-$target.zip"
zip -r $archive_name $target/maa
zip -r $archive_name $dir/maa
else
archive_name="maa_cli-v$version-$target.tar.gz"
tar -czvf $archive_name $target/maa
tar -czvf $archive_name $dir/maa
fi
checksum=$(sha256sum $archive_name)
size=$(stat -c%s $archive_name)
Expand Down

0 comments on commit 6a1e800

Please sign in to comment.