Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upload release/artifact用Actionを解体して個別に実行 #1262

Merged
merged 3 commits into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions .github/actions/upload-release-and-artifact/action.yml

This file was deleted.

100 changes: 63 additions & 37 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ env:
VOICEVOX_ENGINE_VERSION: 0.14.3
VOICEVOX_RESOURCE_VERSION: 0.14.1
VOICEVOX_EDITOR_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999が入る
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999' }}
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、999.999.999-developが入る
${{ github.event.release.tag_name || github.event.inputs.version || '999.999.999-develop' }}
Comment on lines +32 to +33
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

一般的に最新版判定はsemverの比較を使うんですが、999.999.999-developみたくprereleaseタグになっているとたしかすべての比較に引っかからないという特性があります。
0.14<999.999.999-developがfalseになるはず。

なのでこうやってタグを付けておくと安心かなと!


jobs:
build-and-upload:
Expand Down Expand Up @@ -375,18 +375,23 @@ jobs:
7z a -tgzip $name.tar.gz $name.tar
rm $name.tar

- name: Upload Linux tar.gz (without nvidia)
if: startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia')
uses: ./.github/actions/upload-release-and-artifact
- name: Upload Linux tar.gz (without nvidia) to Artifacts
if: startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia') && github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
files: |-
name: ${{ matrix.artifact_name }}-targz
path: |-
${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.tar.gz
upload_release: ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
upload_artifact: ${{ github.event.inputs.upload_artifact }}

- name: Upload Linux tar.gz (without nvidia) to Release Assets
if: startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia') && (github.event.release.tag_name || github.event.inputs.version) != ''
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_EDITOR_VERSION }}
files: |-
${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.tar.gz
target_commitish: ${{ github.sha }}
artifact_name: ${{ matrix.artifact_name }}-targz

- name: Delete Linux tar.gz (without nvidia)
if: startsWith(matrix.artifact_name, 'linux-') && !contains(matrix.artifact_name, 'nvidia')
Expand All @@ -402,18 +407,23 @@ jobs:
7z a -tzip $name.zip prepackage/
7z rn $name.zip prepackage/ VOICEVOX/

- name: Upload Windows & Mac zip (without nvidia)
if: (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia')
uses: ./.github/actions/upload-release-and-artifact
- name: Upload Windows & Mac zip (without nvidia) to Artifacts
if: (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia') && github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
files: |-
name: ${{ matrix.artifact_name }}-zip
path: |-
${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.zip
upload_release: ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
upload_artifact: ${{ github.event.inputs.upload_artifact }}

- name: Upload Windows & Mac zip (without nvidia) to Release Assets
if: (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia') && (github.event.release.tag_name || github.event.inputs.version) != ''
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_EDITOR_VERSION }}
files: |-
${{ matrix.compressed_artifact_name }}-${{ env.VOICEVOX_EDITOR_VERSION }}.zip
target_commitish: ${{ github.sha }}
artifact_name: ${{ matrix.artifact_name }}-zip

- name: Delete Windows & Mac zip (without nvidia)
if: (startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')) && !contains(matrix.artifact_name, 'nvidia')
Expand Down Expand Up @@ -492,31 +502,41 @@ jobs:
mv archives.txt "${{ matrix.installer_artifact_name }}.7z.txt"
done

- name: Upload Linux AppImage split
if: endsWith(matrix.installer_artifact_name, '-appimage')
uses: ./.github/actions/upload-release-and-artifact
- name: Upload Linux AppImage split to Artifacts
if: endsWith(matrix.installer_artifact_name, '-appimage') && github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
files: |-
name: ${{ matrix.installer_artifact_name }}-release
path: |-
dist_electron/*.7z.*
upload_release: ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
upload_artifact: ${{ github.event.inputs.upload_artifact }}

- name: Upload Linux AppImage split to Release Assets
if: endsWith(matrix.installer_artifact_name, '-appimage') && (github.event.release.tag_name || github.event.inputs.version) != ''
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_EDITOR_VERSION }}
files: |-
dist_electron/*.7z.*
target_commitish: ${{ github.sha }}
artifact_name: ${{ matrix.installer_artifact_name }}-release

- name: Upload macOS dmg
if: endsWith(matrix.installer_artifact_name, '-dmg')
uses: ./.github/actions/upload-release-and-artifact
- name: Upload macOS dmg to Artifacts
if: endsWith(matrix.installer_artifact_name, '-dmg') && github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
files: |-
name: ${{ matrix.installer_artifact_name }}-release
path: |-
dist_electron/*.dmg
upload_release: ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
upload_artifact: ${{ github.event.inputs.upload_artifact }}

- name: Upload macOS dmg to Release Assets
if: endsWith(matrix.installer_artifact_name, '-dmg') && (github.event.release.tag_name || github.event.inputs.version) != ''
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_EDITOR_VERSION }}
files: |-
dist_electron/*.dmg
target_commitish: ${{ github.sha }}
artifact_name: ${{ matrix.installer_artifact_name }}

- name: Create Windows NSIS Web artifact directory
if: endsWith(matrix.installer_artifact_name, '-nsis-web')
Expand All @@ -537,16 +557,22 @@ jobs:
NEW_NAME=${OLD_NAME// /.}
mv "${OLD_NAME}" $NEW_NAME

- name: Upload Windows NSIS Web
if: endsWith(matrix.installer_artifact_name, '-nsis-web')
uses: ./.github/actions/upload-release-and-artifact
- name: Upload Windows NSIS Web to Artifacts
if: endsWith(matrix.installer_artifact_name, '-nsis-web') && github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
files: |-
name: ${{ matrix.installer_artifact_name }}-release
path: |-
nsis-web-artifact/*.7z.*
nsis-web-artifact/*.exe
upload_release: ${{ (github.event.release.tag_name || github.event.inputs.version) != '' }}
upload_artifact: ${{ github.event.inputs.upload_artifact }}

- name: Upload Windows NSIS Web to Release Assets
if: endsWith(matrix.installer_artifact_name, '-nsis-web') && (github.event.release.tag_name || github.event.inputs.version) != ''
uses: softprops/action-gh-release@v1
with:
prerelease: ${{ github.event.inputs.prerelease }}
tag_name: ${{ env.VOICEVOX_EDITOR_VERSION }}
files: |-
nsis-web-artifact/*.7z.*
nsis-web-artifact/*.exe
target_commitish: ${{ github.sha }}
artifact_name: ${{ matrix.installer_artifact_name }}