ci-build-upload-binaries #3362
This file contains hidden or 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
| name: ci-build-upload-binaries | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| add_tokio_unstable: | |
| description: 'True to add RUSTFLAGS="--cfg tokio_unstable"' | |
| required: true | |
| default: false | |
| type: boolean | |
| enable_deb: | |
| description: "True to enable cargo-deb installation and .deb package building" | |
| required: false | |
| default: false | |
| type: boolean | |
| schedule: | |
| - cron: "14 0 * * *" | |
| jobs: | |
| publish-nym: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| platform: [ arc-linux-latest ] | |
| runs-on: ${{ matrix.platform }} | |
| env: | |
| CARGO_TERM_COLOR: always | |
| RUSTUP_PERMIT_COPY_RENAME: 1 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Prepare build output directory | |
| shell: bash | |
| env: | |
| OUTPUT_DIR: ci-builds/${{ github.ref_name }} | |
| run: | | |
| rm -rf ci-builds || true | |
| mkdir -p $OUTPUT_DIR | |
| echo $OUTPUT_DIR | |
| - name: Install Dependencies (Linux) | |
| run: sudo apt-get update && sudo apt-get -y install libudev-dev | |
| - name: Sets env vars for tokio if set in manual dispatch inputs | |
| if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true | |
| run: | | |
| echo "RUSTFLAGS=--cfg tokio_unstable" >> $GITHUB_ENV | |
| echo "CARGO_FEATURES=--features tokio-console" >> $GITHUB_ENV | |
| - name: Install Rust toolchain | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }} | |
| - name: Build all binaries | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: build | |
| args: --workspace --release ${{ env.CARGO_FEATURES }} | |
| - name: Install cargo-deb | |
| uses: actions-rs/cargo@v1 | |
| with: | |
| command: install | |
| args: cargo-deb | |
| if: github.event_name == 'workflow_dispatch' && inputs.enable_deb == true | |
| - name: Build deb packages | |
| shell: bash | |
| run: make deb | |
| if: github.event_name == 'workflow_dispatch' && inputs.enable_deb == true | |
| - name: Upload Artifact | |
| if: github.event_name == 'workflow_dispatch' | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: nym-binaries-artifacts | |
| path: | | |
| target/release/nym-client | |
| target/release/nym-socks5-client | |
| target/release/nym-api | |
| target/release/nym-network-requester | |
| target/release/nym-cli | |
| target/release/nymvisor | |
| target/release/nym-node | |
| retention-days: 30 | |
| # If this was a pull_request or nightly, upload to build server | |
| - name: Prepare build output | |
| # if: github.event_name == 'schedule' || github.event_name == 'pull_request' | |
| shell: bash | |
| env: | |
| OUTPUT_DIR: ci-builds/${{ github.ref_name }} | |
| run: | | |
| cp target/release/nym-client $OUTPUT_DIR | |
| cp target/release/nym-socks5-client $OUTPUT_DIR | |
| cp target/release/nym-api $OUTPUT_DIR | |
| cp target/release/nym-network-requester $OUTPUT_DIR | |
| cp target/release/nymvisor $OUTPUT_DIR | |
| cp target/release/nym-node $OUTPUT_DIR | |
| cp target/release/nym-cli $OUTPUT_DIR | |
| if [ ${{ github.event_name == 'workflow_dispatch' && inputs.enable_deb == true }} = true ]; then | |
| cp target/debian/*.deb $OUTPUT_DIR | |
| fi | |
| - name: Deploy branch to CI www | |
| continue-on-error: true | |
| uses: easingthemes/ssh-deploy@main | |
| env: | |
| SSH_PRIVATE_KEY: ${{ secrets.CI_WWW_SSH_PRIVATE_KEY }} | |
| ARGS: "-avzr" | |
| SOURCE: "ci-builds/" | |
| REMOTE_HOST: ${{ secrets.CI_WWW_REMOTE_HOST }} | |
| REMOTE_USER: ${{ secrets.CI_WWW_REMOTE_USER }} | |
| TARGET: ${{ secrets.CI_WWW_REMOTE_TARGET }}/builds/ | |
| EXCLUDE: "/dist/, /node_modules/" |