Skip to content

Commit

Permalink
generic build-and-upload.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
John Sahhar committed Feb 7, 2023
1 parent 13f8472 commit 219e1c7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/build-apple-aarch64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
sudo ./scripts/setup-debian.sh &&
./scripts/build-and-upload.sh aarch64-apple-darwin
7 changes: 3 additions & 4 deletions .github/workflows/build-apple-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
sudo ./scripts/setup-debian.sh &&
./scripts/build-and-upload.sh x86_64-apple-darwin

9 changes: 3 additions & 6 deletions .github/workflows/build-linux-x86_64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
sudo ./scripts/setup-debian.sh &&
./scripts/build-and-upload.sh x86_64-unknown-linux-gnu

7 changes: 7 additions & 0 deletions scripts/build-and-upload.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 219e1c7

Please sign in to comment.