name: ci-build-upload-binaries on: workflow_dispatch: inputs: feature_profile: description: "Select a predefined cargo feature profile" required: false default: "none" type: choice options: - none - tokio-console - otel - otel,tokio-console extra_features: description: "Additional comma-separated cargo features (e.g. feat1,feat2)" required: false default: "" type: string add_tokio_unstable: description: 'Force RUSTFLAGS="--cfg tokio_unstable" (auto-set when tokio-console is selected)' required: false default: false type: boolean enable_deb: description: "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-ubuntu-22.04] 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: Resolve cargo features and RUSTFLAGS if: github.event_name == 'workflow_dispatch' shell: bash run: | FEATURES="" PROFILE="${{ inputs.feature_profile }}" EXTRA="${{ inputs.extra_features }}" if [[ "$PROFILE" != "none" && -n "$PROFILE" ]]; then FEATURES="$PROFILE" fi if [[ -n "$EXTRA" ]]; then if [[ -n "$FEATURES" ]]; then FEATURES="${FEATURES},${EXTRA}" else FEATURES="$EXTRA" fi fi if [[ -n "$FEATURES" ]]; then echo "CARGO_FEATURES=--features ${FEATURES}" >> "$GITHUB_ENV" echo "::notice::Selected cargo features: $FEATURES" else echo "::notice::No additional cargo features selected" fi if [[ "$FEATURES" == *"tokio-console"* ]] || [[ "${{ inputs.add_tokio_unstable }}" == "true" ]]; then echo "RUSTFLAGS=--cfg tokio_unstable" >> "$GITHUB_ENV" echo "::notice::Enabled RUSTFLAGS --cfg tokio_unstable" fi - name: Install Rust toolchain uses: dtolnay/rust-toolchain@master with: toolchain: ${{ vars.REQUIRED_RUSTC_VERSION }} - name: Build all binaries shell: bash run: cargo build --workspace --release ${{ env.CARGO_FEATURES }} - name: Install cargo-deb if: github.event_name == 'workflow_dispatch' && inputs.enable_deb == true shell: bash run: cargo install cargo-deb - name: Build deb packages if: github.event_name == 'workflow_dispatch' && inputs.enable_deb == true shell: bash run: make deb - name: Upload Artifact if: github.event_name == 'workflow_dispatch' uses: actions/upload-artifact@v7 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 - name: Prepare build output 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" ]]; 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/"