From e2fe26a902b501e6d708b33b4ec2b3ca7de2e712 Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Fri, 30 Sep 2022 01:20:51 +0900 Subject: [PATCH] =?UTF-8?q?cbindgen=E3=81=AE=E3=82=A4=E3=83=B3=E3=82=B9?= =?UTF-8?q?=E3=83=88=E3=83=BC=E3=83=AB=E6=99=82=E3=81=ABcargo-quickinstall?= =?UTF-8?q?=E3=81=AE=E3=83=AA=E3=83=9D=E3=82=B8=E3=83=88=E3=83=AA=E3=82=92?= =?UTF-8?q?=E6=98=8E=E7=A4=BA=E7=9A=84=E3=81=AB=E6=8C=87=E5=AE=9A=E3=81=99?= =?UTF-8?q?=E3=82=8B=20(#293)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Explicitly specify cargo-quickinstall releases for cbindgen * Fix the version of cbindgen --- .../cargo-binstall-cbindgen/action.yml | 24 +++++++++++++++++++ .github/workflows/build_and_deploy.yml | 2 +- .github/workflows/generate_document.yml | 2 +- .github/workflows/test.yml | 4 ++-- 4 files changed, 28 insertions(+), 4 deletions(-) create mode 100644 .github/actions/cargo-binstall-cbindgen/action.yml diff --git a/.github/actions/cargo-binstall-cbindgen/action.yml b/.github/actions/cargo-binstall-cbindgen/action.yml new file mode 100644 index 000000000..3ffab73ac --- /dev/null +++ b/.github/actions/cargo-binstall-cbindgen/action.yml @@ -0,0 +1,24 @@ +inputs: + version: + required: true + default: ^0.24 + +runs: + using: composite + steps: + - name: Install cbindgen + shell: bash + run: | + case "$OS" in + Windows) + cargo install cbindgen --version ${{ inputs.version }};; + macOS | Linux ) + cargo binstall \ + cbindgen@${{ inputs.version }} \ + --pkg-url 'https://github.com/alsuren/cargo-quickinstall/releases/download/{ name }-{ version }-{ target }/{ name }-{ version }-{ target }.tar.gz' \ + --pkg-fmt tgz \ + --bin-dir '{ bin }{ binary-ext }' \ + --no-confirm \ + --log-level debug;; + esac + diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index eef9a51e5..543a2275e 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -90,7 +90,7 @@ jobs: - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cbindgen - run: cargo binstall cbindgen@^0.24 --no-confirm + uses: ./.github/actions/cargo-binstall-cbindgen - name: set cargo version if: ${{ env.VERSION != 'DEBUG' }} shell: bash diff --git a/.github/workflows/generate_document.yml b/.github/workflows/generate_document.yml index f459b2cf8..644429810 100644 --- a/.github/workflows/generate_document.yml +++ b/.github/workflows/generate_document.yml @@ -14,7 +14,7 @@ jobs: - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cbindgen - run: cargo binstall cbindgen@^0.24 --no-confirm + uses: ./.github/actions/cargo-binstall-cbindgen - name: Generate C header file run: cbindgen --crate voicevox_core_c_api -o ./docs/apis/c_api/doxygen/voicevox_core.h - name: mkdir public diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 35749d76e..a89ab5162 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -67,7 +67,7 @@ jobs: - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cbindgen - run: cargo binstall cbindgen@^0.24 --no-confirm + uses: ./.github/actions/cargo-binstall-cbindgen - name: Generate voicevox_core_1.h run: cbindgen --crate voicevox_core_c_api -o ./voicevox_core_1.h - name: Generate voicevox_core_2.h @@ -91,7 +91,7 @@ jobs: - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cbindgen - run: cargo binstall cbindgen@^0.24 --no-confirm + uses: ./.github/actions/cargo-binstall-cbindgen - name: build voicevox_core_c_api run: cargo build -p voicevox_core_c_api - name: voicevox_core.hを生成