From 2a1234aee7728a43a113747903800ae8cd83d252 Mon Sep 17 00:00:00 2001 From: msmoiz Date: Wed, 20 May 2026 17:37:01 -0700 Subject: [PATCH 1/3] parse question type arg case insensitively --- src/cli.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cli.rs b/src/cli.rs index 69f12f4..50d6727 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -106,7 +106,7 @@ impl TryFrom> for Args { continue; } - if let Ok(q_type) = QuestionType::from_str(&arg) { + if let Ok(q_type) = QuestionType::from_str(&arg.to_ascii_uppercase()) { match args.q_type.as_ref() { Some(_) => bail!("type specified more than once"), None => args.q_type = Some(q_type), From 93d31dfff324d16cdb32bdc8e38ef7d3ee181b89 Mon Sep 17 00:00:00 2001 From: msmoiz Date: Wed, 20 May 2026 18:03:08 -0700 Subject: [PATCH 2/3] add justfile --- justfile | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 justfile diff --git a/justfile b/justfile new file mode 100644 index 0000000..023e1d0 --- /dev/null +++ b/justfile @@ -0,0 +1,37 @@ +# Lists available recipes. +default: + @just --list + +# Runs tests. +test: + cargo test + +# Builds release artifacts. +[linux] +build: + cargo build --release --target=x86_64-unknown-linux-musl + +# Builds release artifacts. +[macos] +build: + cargo build --release --target=aarch64-apple-darwin + +# Builds release artifacts. +[windows] +build: + cargo build --release --target=x86_64-pc-windows-msvc + +# Publishes the application to the Armory registry. +[linux] +publish: build + armory publish --triple x86_64_linux + +# Publishes the application to the Armory registry. +[macos] +publish: build + armory publish --triple aarch64_darwin + +# Publishes the application to the Armory registry. +[windows] +publish: build + armory publish --triple x86_64_windows From 8d8ccd13f183f66be913c553141f21ad976881f5 Mon Sep 17 00:00:00 2001 From: msmoiz Date: Wed, 20 May 2026 18:09:07 -0700 Subject: [PATCH 3/3] add ci workflows --- .github/workflows/merge-main.yaml | 70 +++++++++++++++++++++++++++++ .github/workflows/pull-request.yaml | 39 ++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 .github/workflows/merge-main.yaml create mode 100644 .github/workflows/pull-request.yaml diff --git a/.github/workflows/merge-main.yaml b/.github/workflows/merge-main.yaml new file mode 100644 index 0000000..3bd432d --- /dev/null +++ b/.github/workflows/merge-main.yaml @@ -0,0 +1,70 @@ +name: Merge to main + +on: + push: + branches: [main] + tags: + - '*' + +jobs: + build-test-publish: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + env: + ARMORY_PASSWORD: ${{ secrets.ARMORY_PASSWORD }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: "rust-cache" + + - name: Install just + uses: extractions/setup-just@v3 + + - name: Install Rust target (Linux) + if: runner.os == 'Linux' + run: rustup target add x86_64-unknown-linux-musl + + - name: Install musl tools (Linux) + if: runner.os == 'Linux' + run: sudo apt-get install -y musl-tools + + - name: Build + run: just build + + - name: Test + run: just test + + - name: Check for tag + id: check-tag + shell: bash + run: | + if git tag --points-at HEAD | grep -q .; then + echo "has_tag=true" >> $GITHUB_OUTPUT + else + echo "has_tag=false" >> $GITHUB_OUTPUT + fi + + - name: Install Armory (Unix) + if: steps.check-tag.outputs.has_tag == 'true' && runner.os != 'Windows' + run: | + curl https://armory.msmoiz.com/install.sh | sh + echo "$HOME/.armory/bin" >> $GITHUB_PATH + + - name: Install Armory (Windows) + if: steps.check-tag.outputs.has_tag == 'true' && runner.os == 'Windows' + run: | + Invoke-RestMethod https://armory.msmoiz.com/install.ps1 | Invoke-Expression + "$env:USERPROFILE\.armory\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Publish + if: steps.check-tag.outputs.has_tag == 'true' + run: just publish diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml new file mode 100644 index 0000000..ac996dd --- /dev/null +++ b/.github/workflows/pull-request.yaml @@ -0,0 +1,39 @@ +name: Validate pull request + +on: + pull_request: + types: [opened, synchronize, reopened] + +jobs: + build-and-test: + strategy: + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Rust cache + uses: Swatinem/rust-cache@v2 + with: + shared-key: "rust-cache" + + - name: Install just + uses: extractions/setup-just@v3 + + - name: Install Rust target (Linux) + if: runner.os == 'Linux' + run: rustup target add x86_64-unknown-linux-musl + + - name: Install musl tools (Linux) + if: runner.os == 'Linux' + run: sudo apt-get install -y musl-tools + + - name: Build + run: just build + + - name: Test + run: just test