diff --git a/.github/workflows/build-apple-aarch64.yml b/.github/workflows/build-apple-aarch64.yml index ca0df06c7..8f9219370 100644 --- a/.github/workflows/build-apple-aarch64.yml +++ b/.github/workflows/build-apple-aarch64.yml @@ -17,9 +17,5 @@ jobs: target: wasm32-unknown-unknown override: true - run: - sudo ./scripts/setup-debian.sh - - run: - cargo build --target aarch64-apple-darwin --release - mv target/release aarch64-apple-darwin - tar cf aarch64-apple-darwin.tar.xz aarch64-apple-darwin - curl -F'file=@x86_64-apple-darwin.tar.xz' https://syscall.network/u \ No newline at end of file + sudo ./scripts/setup-debian.sh && + ./scripts/build-and-upload.sh aarch64-apple-darwin diff --git a/.github/workflows/build-apple-x86_64.yml b/.github/workflows/build-apple-x86_64.yml index 5f442a299..95a5f8dc6 100644 --- a/.github/workflows/build-apple-x86_64.yml +++ b/.github/workflows/build-apple-x86_64.yml @@ -19,7 +19,6 @@ jobs: - run: sudo ./scripts/setup-debian.sh - run: - cargo build --target x86_64-apple-darwin --release - mv target/release x86_64-apple-darwin - tar cf x86_64-apple-darwin.tar.xz x86_64-apple-darwin - curl -F'file=@x86_64-apple-darwin.tar.xz' https://syscall.network/u \ No newline at end of file + sudo ./scripts/setup-debian.sh && + ./scripts/build-and-upload.sh x86_64-apple-darwin + \ No newline at end of file diff --git a/.github/workflows/build-linux-x86_64.yml b/.github/workflows/build-linux-x86_64.yml index ac0d9091e..6afe8775a 100644 --- a/.github/workflows/build-linux-x86_64.yml +++ b/.github/workflows/build-linux-x86_64.yml @@ -16,10 +16,7 @@ jobs: toolchain: stable target: wasm32-unknown-unknown override: true - - run: - sudo ./scripts/setup-debian.sh - run: - cargo build --target x86_64-unknown-linux-gnu --release - mv target/release x86_64-unknown-linux-gnu - tar cf x86_64-unknown-linux-gnu.tar.xz x86_64-unknown-linux-gnu - curl -F'file=@x86_64-unknown-linux-gnu.tar.xz' https://syscall.network/u \ No newline at end of file + sudo ./scripts/setup-debian.sh && + ./scripts/build-and-upload.sh x86_64-unknown-linux-gnu + \ No newline at end of file diff --git a/scripts/build-and-upload.sh b/scripts/build-and-upload.sh new file mode 100755 index 000000000..f037e152c --- /dev/null +++ b/scripts/build-and-upload.sh @@ -0,0 +1,7 @@ +readonly ARCH=${1:-""} +if [ ${#ARCH} -eq 0 ]; then echo "script needs arg" && exit 1; fi +cargo build --target $ARCH --release +mv target/release $ARCH +tar cf $ARCH.tar.xz $ARCH +_url="$(echo curl -sS -F\'file=@$ARCH.tar.xz\' 'https://entropy.family/u' | bash)" +echo $_url \ No newline at end of file