From 41feb8ce813e4b3cde927420c0b582a1d7d43e79 Mon Sep 17 00:00:00 2001 From: Nor Khasyatillah Date: Thu, 22 Aug 2024 12:39:20 +0700 Subject: [PATCH] update CI --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 7 +++++++ build.rs | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b7440a..25f5080 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ on: env: CARGO_TERM_COLOR: always - OUT_DIR: . + OUT_DIR: target jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 637fdef..244f776 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -8,6 +8,9 @@ on: tags: - v[0-9]+.* +env: + OUT_DIR: target + jobs: upload-assets: strategy: @@ -31,6 +34,10 @@ jobs: # [default value: windows] # [possible values: all, unix, windows, none] zip: windows + # create dir + leading-dir: true + # additional files + include: target/completions env: # (required) GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/build.rs b/build.rs index 2220c38..d80e9ed 100644 --- a/build.rs +++ b/build.rs @@ -7,7 +7,7 @@ fn main() -> Result<(), clap::Error> { use clap_complete::{generate_to, Shell}; use std::{env, fs, path}; - let out_dir = env::var_os("OUT_DIR").expect("OUT_DIR not set"); + let out_dir = env!("OUT_DIR"); let dir = path::Path::new(&out_dir).join("completions/"); if !dir.exists() { fs::create_dir(dir.clone()).expect("Failed to create 'completions' directory.");