Skip to content

Commit

Permalink
Github Actionsのinputsはbooleanが正しくなるので修正 (#638)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Oct 12, 2023
1 parent b148c94 commit 6d3d634
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
36 changes: 18 additions & 18 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ jobs:
build_and_deploy:
needs: config
environment: ${{ inputs.is_production == 'true' && 'production' || '' }} # 製品版のenvironment
environment: ${{ inputs.is_production && 'production' || '' }} # 製品版のenvironment
strategy:
matrix:
include: ${{ fromJson(needs.config.outputs.includes) }}
Expand All @@ -193,14 +193,14 @@ jobs:
ASSET_NAME: voicevox_core-${{ matrix.artifact_name }}-${{ needs.config.outputs.version }}
steps:
- uses: actions/checkout@v3 # 製品版ではない場合
if: ${{ inputs.is_production != 'true' }}
if: ${{ !inputs.is_production }}
- uses: actions/checkout@v3 # 製品版の場合
if: ${{ inputs.is_production == 'true' }}
if: inputs.is_production
with:
fetch-depth: 0 # 全履歴取得
token: ${{ secrets.PRODUCTION_GITHUB_TOKEN }}
- name: Merge production branch
if: inputs.is_production == 'true'
if: inputs.is_production
shell: bash
run: |
(
Expand Down Expand Up @@ -233,21 +233,21 @@ jobs:
echo "$ANDROID_NDK/toolchains/llvm/prebuilt/linux-x86_64/bin" >> "$GITHUB_PATH"
echo "AR_${{ matrix.target }}=llvm-ar" >> "$GITHUB_ENV"
- name: Checkout VOICEVOX RESOURCE
if: inputs.is_production == 'true'
if: inputs.is_production
uses: actions/checkout@v3
with:
repository: VOICEVOX/voicevox_resource
ref: ${{ env.VOICEVOX_RESOURCE_VERSION }}
path: download/resource
- name: Checkout VOICEVOX FAT RESOURCE
if: inputs.is_production == 'true'
if: inputs.is_production
uses: actions/checkout@v3
with:
repository: VOICEVOX/voicevox_fat_resource
ref: ${{ env.VOICEVOX_FAT_RESOURCE_VERSION }}
path: download/fat_resource
- name: Raplace resource
if: inputs.is_production == 'true'
if: inputs.is_production
shell: bash
run: |
mv -f download/resource/core/README.md ./README.md
Expand All @@ -262,14 +262,14 @@ jobs:
if ${{ !!matrix.whl_local_version }}; then cargo set-version "$VERSION+"${{ matrix.whl_local_version }} -p voicevox_core_python_api; fi
- name: cache target
uses: Swatinem/rust-cache@v2
if: inputs.is_production != 'true'
if: ${{ !inputs.is_production }}
- name: build voicevox_core_c_api
shell: bash
run: |
function build() {
cargo build -p voicevox_core_c_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -286,7 +286,7 @@ jobs:
function build() {
maturin build --manifest-path ./crates/voicevox_core_python_api/Cargo.toml --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -300,7 +300,7 @@ jobs:
function build() {
cargo build -p voicevox_core_java_api -vv --features ${{ matrix.features }}, --target ${{ matrix.target }} --release
}
if ${{ inputs.is_production != 'true' }}; then
if ${{ !inputs.is_production }}; then
build
else
build > /dev/null 2>&1
Expand All @@ -321,7 +321,7 @@ jobs:
mkdir java_artifact
cp -v target/${{ matrix.target }}/release/libvoicevox_core_java_api.so java_artifact/ || true
- name: Code signing (Windows)
if: startsWith(matrix.os, 'windows') && inputs.code_signing == 'true'
if: startsWith(matrix.os, 'windows') && inputs.code_signing
run: |
bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll"
env:
Expand All @@ -339,7 +339,7 @@ jobs:
cd artifact
7z a "../${{ env.ASSET_NAME }}.zip" "${{ env.ASSET_NAME }}"
- name: Upload to Release
if: needs.config.outputs.deploy == 'true' && !contains(matrix.target, 'ios')
if: fromJson(needs.config.outputs.deploy) && !contains(matrix.target, 'ios')
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -348,7 +348,7 @@ jobs:
${{ env.ASSET_NAME }}.zip
target_commitish: ${{ github.sha }}
- name: Upload Python whl to Release
if: needs.config.outputs.deploy == 'true' && matrix.whl_local_version
if: fromJson(needs.config.outputs.deploy) && matrix.whl_local_version
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -357,7 +357,7 @@ jobs:
${{ steps.build-voicevox-core-python-api.outputs.whl }}
target_commitish: ${{ github.sha }}
- name: Upload voicevox_core_java_api artifact
if: needs.config.outputs.deploy == 'true' && contains(matrix.target, 'android')
if: fromJson(needs.config.outputs.deploy) && contains(matrix.target, 'android')
uses: actions/upload-artifact@v3
with:
name: voicevox_core_java_api-${{ matrix.artifact_name }}
Expand Down Expand Up @@ -408,7 +408,7 @@ jobs:
cd artifact/${{ env.ASSET_NAME }}
7z a "../../${{ env.ASSET_NAME }}.zip" "voicevox_core.xcframework"
- name: Upload to Release
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand Down Expand Up @@ -482,7 +482,7 @@ jobs:
zip -r /tmp/java_packages.zip .
- name: Upload to Release
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -493,7 +493,7 @@ jobs:

download_test:
needs: [config, build_and_deploy]
if: needs.config.outputs.deploy == 'true'
if: fromJson(needs.config.outputs.deploy)
uses: ./.github/workflows/download_test.yml
with:
version: ${{ inputs.version }}
4 changes: 2 additions & 2 deletions .github/workflows/build_and_deploy_downloader.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ defaults:

jobs:
deploy_and_deploy_downloader:
environment: ${{ inputs.is_production == 'true' && 'production' || '' }} # コード署名用のenvironment
environment: ${{ inputs.is_production && 'production' || '' }} # コード署名用のenvironment
strategy:
matrix:
include:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
mv $"target/${{ matrix.target }}/release/download$exe_suffix" ./${{ matrix.name }}
- name: Code signing (Windows)
if: startsWith(matrix.os, 'windows') && inputs.code_signing == 'true'
if: startsWith(matrix.os, 'windows') && inputs.code_signing
run: |
bash build_util/codesign.bash ./${{ matrix.name }}
env:
Expand Down

0 comments on commit 6d3d634

Please sign in to comment.