forked from jl777/SuperNET
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6544f6d
commit bc20355
Showing
5 changed files
with
200 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: Install Dependencies | ||
description: Install non-cargo dependencies in an OS-agnostic way | ||
|
||
inputs: | ||
deps: | ||
description: "Dependencies to install (format: ('list' 'of' 'dependencies'))." | ||
required: true | ||
temp: | ||
description: "A temporary directory path that can be used to store the installed binaries if needed." | ||
|
||
# NOTE: Don't install binaries in the project directory because the directory might be checked out later. | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Install protoc (Linux) | ||
env: | ||
TMP: ${{ inputs.temp || runner.temp }} | ||
if: ${{ runner.os == 'Linux' && contains(inputs.deps, 'protoc') }} | ||
shell: bash | ||
run: | | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip | ||
unzip protoc-25.3-linux-x86_64 -d "$TMP/protobuf" | ||
echo "$TMP/protobuf/bin" >> $GITHUB_PATH | ||
- name: Install protoc (MacOS) | ||
env: | ||
TMP: ${{ inputs.temp || runner.temp }} | ||
if: ${{ runner.os == 'macOS' && contains(inputs.deps, 'protoc') }} | ||
shell: bash | ||
run: | | ||
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-x86_64.zip | ||
unzip protoc-25.3-osx-x86_64.zip -d "$TMP/protobuf" | ||
echo "$TMP/protobuf/bin" >> $GITHUB_PATH | ||
- name: Install protoc (Windows) | ||
env: | ||
TMP: ${{ inputs.temp || runner.temp }} | ||
if: ${{ runner.os == 'Windows' && contains(inputs.deps, 'protoc') }} | ||
shell: powershell | ||
run: | | ||
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip -OutFile protoc-25.3-win64.zip | ||
7z x protoc-25.3-win64.zip -o"$TMP\protobuf" | ||
echo "$TMP\protobuf\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | ||
- name: Install libudev (Linux) | ||
if: ${{ runner.os == 'Linux' && contains(inputs.deps, 'libudev') }} | ||
shell: bash | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y libudev-dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,9 +35,9 @@ jobs: | |
rustup default nightly-2022-10-29 | ||
- name: Install build deps | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y protobuf-compiler | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Calculate commit hash for PR commit | ||
if: github.event_name == 'pull_request' | ||
|
@@ -97,6 +97,11 @@ jobs: | |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal | ||
rustup default nightly-2022-10-29 | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Calculate commit hash for PR commit | ||
if: github.event_name == 'pull_request' | ||
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV | ||
|
@@ -115,19 +120,15 @@ jobs: | |
cargo build --bin mm2 --release --target x86_64-apple-darwin | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-mac-x86-64.zip" | ||
zip $NAME target/x86_64-apple-darwin/release/mm2 -j | ||
mkdir $BRANCH_NAME | ||
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -147,6 +148,11 @@ jobs: | |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal | ||
rustup default nightly-2022-10-29 | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Calculate commit hash for PR commit | ||
if: github.event_name == 'pull_request' | ||
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV | ||
|
@@ -167,19 +173,15 @@ jobs: | |
cargo build --bin mm2 --release | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
$NAME="mm2_$Env:COMMIT_HASH-win-x86-64.zip" | ||
7z a $NAME .\target\release\mm2.exe .\target\release\*.dll | ||
mkdir $Env:BRANCH_NAME | ||
mv $NAME ./$Env:BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -199,6 +201,11 @@ jobs: | |
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal | ||
rustup default nightly-2022-10-29 | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Calculate commit hash for PR commit | ||
if: github.event_name == 'pull_request' | ||
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV | ||
|
@@ -217,9 +224,7 @@ jobs: | |
cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-mac-dylib-x86-64.zip" | ||
mv target/x86_64-apple-darwin/release/libmm2lib.a target/x86_64-apple-darwin/release/libmm2.a | ||
|
@@ -228,9 +233,7 @@ jobs: | |
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -254,6 +257,11 @@ jobs: | |
echo "/usr/bin" >> $GITHUB_PATH | ||
echo "/root/.cargo/bin" >> $GITHUB_PATH | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Install toolchain | ||
run: | | ||
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal | ||
|
@@ -281,19 +289,15 @@ jobs: | |
wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-wasm.zip" | ||
(cd ./target/target-wasm-release && zip -r - .) > $NAME | ||
mkdir $BRANCH_NAME | ||
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -314,6 +318,11 @@ jobs: | |
rustup default nightly-2022-10-29 | ||
rustup target add aarch64-apple-ios | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Calculate commit hash for PR commit | ||
if: github.event_name == 'pull_request' | ||
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV | ||
|
@@ -332,9 +341,7 @@ jobs: | |
cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-ios-aarch64.zip" | ||
mv target/aarch64-apple-ios/release/libmm2lib.a target/aarch64-apple-ios/release/libmm2.a | ||
|
@@ -343,9 +350,7 @@ jobs: | |
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -375,6 +380,11 @@ jobs: | |
rustup default nightly-2022-10-29 | ||
rustup target add aarch64-linux-android | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Setup NDK | ||
run: ./scripts/ci/android-ndk.sh x86 23 | ||
|
||
|
@@ -398,20 +408,16 @@ jobs: | |
CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --release --crate-type=staticlib --package mm2_bin_lib | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-android-aarch64.zip" | ||
mv target/aarch64-linux-android/release/libmm2lib.a target/aarch64-linux-android/release/libmm2.a | ||
zip $NAME target/aarch64-linux-android/release/libmm2.a -j | ||
zip $NAME target/aarch64-linux-android/release/libmm2.a -j | ||
mkdir $BRANCH_NAME | ||
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
@@ -441,6 +447,11 @@ jobs: | |
rustup default nightly-2022-10-29 | ||
rustup target add armv7-linux-androideabi | ||
- name: Install build deps | ||
uses: ./.github/actions/deps-install | ||
with: | ||
deps: ('protoc') | ||
|
||
- name: Setup NDK | ||
run: ./scripts/ci/android-ndk.sh x86 23 | ||
|
||
|
@@ -464,20 +475,16 @@ jobs: | |
CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --release --crate-type=staticlib --package mm2_bin_lib | ||
- name: Compress build output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
run: | | ||
NAME="mm2_$COMMIT_HASH-android-armv7.zip" | ||
mv target/armv7-linux-androideabi/release/libmm2lib.a target/armv7-linux-androideabi/release/libmm2.a | ||
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j | ||
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j | ||
mkdir $BRANCH_NAME | ||
mv $NAME ./$BRANCH_NAME/ | ||
- name: Upload output | ||
env: | ||
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }} | ||
if: ${{ env.AVAILABLE != '' }} | ||
if: env.FILE_SERVER_AVAILABLE | ||
uses: garygrossgarten/[email protected] | ||
with: | ||
host: ${{ secrets.FILE_SERVER_HOST }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.