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_wireguard: description: 'Add --features wireguard' required: true default: false type: boolean schedule: - cron: '14 0 * * *' pull_request: paths: - "clients/**" - "common/**" - "explorer-api/**" - "gateway/**" - "integrations/**" - "mixnode/**" - "nym-api/**" - "nym-node/**" - "nym-outfox/**" - "nym-validator-rewarder/**" - "sdk/rust/nym-sdk/**" - "service-providers/**" - "tools/**" jobs: publish-nym: strategy: fail-fast: false matrix: platform: [ubuntu-20.04] runs-on: ${{ matrix.platform }} env: CARGO_TERM_COLOR: always steps: - uses: actions/checkout@v3 - 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 update && sudo apt install libudev-dev - name: Sets env vars for tokio if set in manual dispatch inputs run: | echo 'RUSTFLAGS="--cfg tokio_unstable"' >> $GITHUB_ENV if: github.event_name == 'workflow_dispatch' && inputs.add_tokio_unstable == true - name: Set CARGO_FEATURES run: | echo 'CARGO_FEATURES=--features wireguard' >> $GITHUB_ENV if: > github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && inputs.enable_wireguard == true) - name: Install Rust stable uses: actions-rs/toolchain@v1 with: toolchain: stable - 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 - name: Build deb packages shell: bash run: make deb # If this was a manual workflow_dispatch, publish binaries. - name: Upload Artifact if: github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v3 with: name: nym-binaries-artifacts path: | target/release/nym-client target/release/nym-gateway target/release/nym-mixnode target/release/nym-socks5-client target/release/nym-api target/release/nym-network-requester target/release/nym-network-statistics target/release/nym-cli 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-gateway $OUTPUT_DIR cp target/release/nym-mixnode $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/nym-network-statistics $OUTPUT_DIR cp target/release/nym-cli $OUTPUT_DIR cp target/release/explorer-api $OUTPUT_DIR cp target/debian/*.deb $OUTPUT_DIR - name: Deploy branch to CI www # if: github.event_name == 'schedule' || github.event_name == 'pull_request' 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/"