Skip to content

enhancement(dev): Add dedicated dev tool #14990

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 19 commits into from
Closed
51 changes: 51 additions & 0 deletions .github/workflows/actions/install-vdev/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Install vdev

inputs:
token:
required: true

runs:
using: composite

steps:
# default 2.x fails
- if: runner.os == 'Windows'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.1'

- name: Wait for build
uses: lewagon/[email protected]
with:
repo-token: ${{ inputs.token }}
check-name: Build executable for ${{ runner.os }}
ref: ${{ github.sha }}
wait-interval: 20

- name: Try downloading current artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ inputs.token }}
workflow: build-vdev.yml
branch: ${{ github.ref_name }}
name: vdev-${{ runner.os }}
path: vdev/bin

- if: github.event_name == 'pull_request' && failure()
name: Download latest artifact
uses: dawidd6/action-download-artifact@v2
with:
github_token: ${{ inputs.token }}
workflow: build-vdev.yml
branch: master
name: vdev-${{ runner.os }}
path: vdev/bin

- name: Add binary to PATH
run: mv vdev/bin/* "$HOME/.cargo/bin"
shell: bash

- if: runner.os != 'Windows'
name: Make binary executable
run: chmod +x "$HOME/.cargo/bin/vdev"
shell: bash
43 changes: 43 additions & 0 deletions .github/workflows/build-vdev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build vdev

on:
push:
branches:
- master
pull_request:
branches:
- master
paths:
- "vdev/**/*"

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true

jobs:
exe:
# Name must match runner.os https://docs.github.com/en/actions/learn-github-actions/contexts#runner-context
name: Build executable for ${{ startsWith(matrix.os, 'macos-') && 'macOS' || startsWith(matrix.os, 'windows-') && 'Windows' || 'Linux' }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v3

- name: Build release binary
run: |
cd vdev
cargo build --release

- if: runner.os != 'Windows'
name: Strip binary
run: strip vdev/target/release/vdev

- uses: actions/upload-artifact@v3
with:
name: vdev-${{ runner.os }}
path: vdev/target/release/${{ runner.os == 'Windows' && 'vdev.exe' || 'vdev' }}
if-no-files-found: error
Loading