diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 9283b273d..0c67f8283 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -65,6 +65,7 @@ jobs: "artifact_name": "windows-x64", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": false }, { @@ -73,6 +74,7 @@ jobs: "artifact_name": "windows-x86", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": true }, { @@ -81,6 +83,7 @@ jobs: "artifact_name": "linux-x64", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": false }, { @@ -89,6 +92,7 @@ jobs: "artifact_name": "linux-arm64", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": true }, { @@ -97,6 +101,7 @@ jobs: "artifact_name": "android-arm64", "c_release_format": "plain-cdylib", "python_whl": false, + "java": true, "can_skip_in_simple_test": true }, { @@ -105,6 +110,7 @@ jobs: "artifact_name": "android-x86_64", "c_release_format": "plain-cdylib", "python_whl": false, + "java": true, "can_skip_in_simple_test": true }, { @@ -113,6 +119,7 @@ jobs: "artifact_name": "osx-arm64", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": false }, { @@ -121,6 +128,7 @@ jobs: "artifact_name": "osx-x64", "c_release_format": "plain-cdylib", "python_whl": true, + "java": true, "can_skip_in_simple_test": true }, { @@ -129,6 +137,7 @@ jobs: "artifact_name": "ios-arm64-cpu", "c_release_format": "ios-xcframework", "python_whl": false, + "java": false, "can_skip_in_simple_test": true }, { @@ -137,6 +146,7 @@ jobs: "artifact_name": "ios-arm64-cpu-sim", "c_release_format": "ios-xcframework", "python_whl": false, + "java": false, "can_skip_in_simple_test": true }, { @@ -145,6 +155,7 @@ jobs: "artifact_name": "ios-x64-cpu", "c_release_format": "ios-xcframework", "python_whl": false, + "java": false, "can_skip_in_simple_test": true } ]' @@ -213,11 +224,10 @@ jobs: repository: VOICEVOX/voicevox_resource ref: ${{ env.VOICEVOX_RESOURCE_VERSION }} path: download/resource - - name: Raplace resource + - name: Replace resource if: inputs.is_production shell: bash - run: - mv -f download/resource/core/README.md ./README.md + run: mv -f download/resource/core/README.md ./README.md - name: Install cargo-binstall uses: taiki-e/install-action@cargo-binstall - name: Install cargo-edit @@ -264,7 +274,7 @@ jobs: fi echo "whl=$(find ./target/wheels -type f)" >> "$GITHUB_OUTPUT" - name: build voicevox_core_java_api - if: contains(matrix.target, 'android') + if: ${{ matrix.java }} run: | function build() { cargo build -p voicevox_core_java_api -vv --target ${{ matrix.target }} --release @@ -289,11 +299,10 @@ jobs: echo "${{ env.VERSION }}" > "artifact/${{ env.ASSET_NAME }}/VERSION" mkdir java_artifact - cp -v target/${{ matrix.target }}/release/libvoicevox_core_java_api.so java_artifact/ || true + cp -v target/${{ matrix.target }}/release/*voicevox_core_java_api.{dll,so,dylib} "java_artifact" || true - name: Code signing (Windows) if: startsWith(matrix.os, 'windows') && inputs.code_signing - run: - bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" + run: bash build_util/codesign.bash "artifact/${{ env.ASSET_NAME }}/voicevox_core.dll" env: ESIGNERCKA_USERNAME: ${{ secrets.ESIGNERCKA_USERNAME }} ESIGNERCKA_PASSWORD: ${{ secrets.ESIGNERCKA_PASSWORD }} @@ -327,7 +336,7 @@ jobs: ${{ steps.build-voicevox-core-python-api.outputs.whl }} target_commitish: ${{ github.sha }} - name: Upload voicevox_core_java_api artifact - if: fromJson(needs.config.outputs.deploy) && contains(matrix.target, 'android') + if: fromJson(needs.config.outputs.deploy) && matrix.java uses: actions/upload-artifact@v4 with: name: voicevox_core_java_api-${{ matrix.artifact_name }} @@ -391,11 +400,10 @@ jobs: repository: VOICEVOX/voicevox_fat_resource ref: ${{ env.VOICEVOX_FAT_RESOURCE_VERSION }} path: download/fat_resource - - name: Raplace resource + - name: Replace resource if: inputs.is_production shell: bash - run: - rm -r ./model; mv download/fat_resource/core/model ./model + run: rm -r ./model; mv download/fat_resource/core/model ./model - name: Create artifact run: | mkdir "artifact" @@ -436,40 +444,82 @@ jobs: - name: Install cargo-edit run: cargo binstall cargo-edit@^0.11 --no-confirm - name: set cargo version - run: - cargo set-version "$VERSION" -p voicevox_core_java_api + run: cargo set-version "$VERSION" -p voicevox_core_java_api - - name: "Download artifact (android-arm64)" + - name: "Download artifact" uses: actions/download-artifact@v4 with: - name: voicevox_core_java_api-android-arm64 - path: artifact/android-arm64 - - - name: "Download artifact (android-x86_64)" - uses: actions/download-artifact@v4 - with: - name: voicevox_core_java_api-android-x86_64 - path: artifact/android-x86_64 + pattern: voicevox_core_java_api-* + path: artifacts/ - name: Print tree - run: tree artifact + run: tree artifacts - - name: Build voicevoxcore-android + - name: Build voicevoxcore run: | - rm -rf crates/voicevox_core_java_api/lib/src/main/resources/dll - cat <