Skip to content

Commit

Permalink
build_and_deployの最後にdownload_testを実行 (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hiroshiba authored Sep 18, 2023
1 parent 814d270 commit 6a66275
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 8 deletions.
22 changes: 15 additions & 7 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ defaults:
shell: bash

jobs:
build_and_deploy_strategy_matrix: # 実行対象の条件をフィルタリングする
config: # 全 jobs で利用する定数の定義。実行対象の条件をフィルタリングする
runs-on: ubuntu-latest
outputs:
includes: ${{ steps.strategy_matrix.outputs.includes }}
deploy: ${{ env.VERSION != '0.0.0' }}
steps:
- name: declare strategy matrix
id: strategy_matrix
Expand Down Expand Up @@ -181,11 +182,11 @@ jobs:
echo "includes=${includes}" >> "$GITHUB_OUTPUT"
build_and_deploy:
needs: build_and_deploy_strategy_matrix
needs: config
environment: ${{ github.event.inputs.is_production == 'true' && 'production' || '' }} # 製品版のenvironment
strategy:
matrix:
include: ${{ fromJson(needs.build_and_deploy_strategy_matrix.outputs.includes) }}
include: ${{ fromJson(needs.config.outputs.includes) }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3 # 製品版ではない場合
Expand Down Expand Up @@ -318,7 +319,7 @@ jobs:
cd artifact
7z a "../${{ env.ASSET_NAME }}.zip" "${{ env.ASSET_NAME }}"
- name: Upload to Release
if: env.VERSION != '0.0.0' && env.SKIP_UPLOADING_RELEASE_ASSET == '0' && !contains(matrix.target, 'ios')
if: needs.config.outputs.deploy == 'true' && env.SKIP_UPLOADING_RELEASE_ASSET == '0' && !contains(matrix.target, 'ios')
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -327,7 +328,7 @@ jobs:
${{ env.ASSET_NAME }}.zip
target_commitish: ${{ github.sha }}
- name: Upload Python whl to Release
if: env.VERSION != '0.0.0' && matrix.whl_local_version
if: needs.config.outputs.deploy == 'true' && matrix.whl_local_version
uses: softprops/action-gh-release@v1
with:
prerelease: true
Expand All @@ -338,7 +339,7 @@ jobs:

build_xcframework:
if: ${{ !(github.event_name != 'release' && github.event_name != 'workflow_dispatch') }} # !env.IS_SIMPLE_TEST と同じ
needs: build_and_deploy
needs: [config, build_and_deploy]
runs-on: macos-12
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -381,11 +382,18 @@ jobs:
cd artifact/${{ env.ASSET_NAME }}
7z a "../../${{ env.ASSET_NAME }}.zip" "voicevox_core.xcframework"
- name: Upload to Release
if: env.VERSION != '0.0.0' && env.SKIP_UPLOADING_RELEASE_ASSET == '0'
if: needs.config.outputs.deploy == 'true' && env.SKIP_UPLOADING_RELEASE_ASSET == '0'
uses: softprops/action-gh-release@v1
with:
prerelease: true
tag_name: ${{ env.VERSION }}
files: |-
${{ env.ASSET_NAME }}.zip
target_commitish: ${{ github.sha }}

download_test:
needs: [config, build_and_deploy]
if: needs.config.outputs.deploy == 'true'
uses: ./.github/workflows/download_test.yml
with:
version: ${{ inputs.version }}
9 changes: 8 additions & 1 deletion .github/workflows/download_test.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
name: Download test workflow

on:
workflow_call:
inputs:
version:
description: "テスト対象のコアのバージョン。無指定時はprerelease込みの最新release。"
type: string
required: false
push:
branches:
- main
Expand All @@ -10,7 +17,7 @@ on:
- ".github/workflows/download_test.yml"

env:
VERSION: "prerelease-latest"
VERSION: ${{ inputs.version || 'prerelease-latest' }}

defaults:
run:
Expand Down

0 comments on commit 6a66275

Please sign in to comment.