Skip to content

Commit

Permalink
zipファイルをreleaseにアップロードする (#656)
Browse files Browse the repository at this point in the history
* zipファイルをreleaseにアップロードする

* upload-distributable-to-releaseのmatrix.artifact_nameの項目が不足していた

* linuxはtargzに

* .tar.gz
  • Loading branch information
Hiroshiba authored Jan 23, 2022
1 parent e276e57 commit 2caa341
Showing 1 changed file with 32 additions and 40 deletions.
72 changes: 32 additions & 40 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -272,31 +272,33 @@ jobs:
noengine_artifact_name: linux-noengine-prepackage
voicevox_engine_asset_name: linux-nvidia
linux_executable_name: voicevox
targz_name: VOICEVOX
compressed_artifact_name: voicevox-linux-nvidia
app_asar_dir: prepackage/resources
# Linux CPU
- artifact_name: linux-cpu-prepackage
noengine_artifact_name: linux-noengine-cpu-prepackage
voicevox_engine_asset_name: linux-cpu
linux_executable_name: voicevox
targz_name: VOICEVOX-CPU
compressed_artifact_name: voicevox-linux-cpu
app_asar_dir: prepackage/resources
# Windows NVIDIA GPU
- artifact_name: windows-nvidia-prepackage
noengine_artifact_name: windows-noengine-prepackage
voicevox_engine_asset_name: windows-nvidia
compressed_artifact_name: voicevox-windows-nvidia
app_asar_dir: prepackage/resources
# Windows CPU
- artifact_name: windows-cpu-prepackage
noengine_artifact_name: windows-noengine-cpu-prepackage
voicevox_engine_asset_name: windows-cpu
compressed_artifact_name: voicevox-windows-cpu
app_asar_dir: prepackage/resources
# macOS CPU
- artifact_name: macos-cpu-prepackage
noengine_artifact_name: macos-noengine-cpu-prepackage
voicevox_engine_asset_name: macos-x64
macos_executable_name: VOICEVOX
zip_name: voicevox-cpu-macos-x64
compressed_artifact_name: voicevox-macos-cpu
app_asar_dir: prepackage/VOICEVOX.app/Contents/Resources

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -450,57 +452,37 @@ jobs:
run: mkdir -p prepackage/VOICEVOX.app/Contents/Resources/ja.lproj prepackage/VOICEVOX.app/Contents/Resources/en.lproj

- name: Set BUILD_IDENTIFIER env var
if: startsWith(matrix.artifact_name, 'linux-') # linux
shell: bash
run: |
echo "BUILD_IDENTIFIER=${GITHUB_REF##*/}" >> $GITHUB_ENV
# Create tar.gz for Linux
#
# Due to GitHub Actions limitation (https://github.com/actions/upload-artifact/issues/38),
# file permissions are lost in actions/upload-artifact.
# To distribute binaries (voicevox, run) with execute permission,
# we need to pack all the files in tarball (tar.gz) before uploading.
# https://github.com/actions/upload-artifact/blob/11e311c8b504ea40cbed20583a64d75b4735cff3/README.md#maintaining-file-permissions-and-case-sensitive-files
#
# voicevox-x.x.x.tar.gz
# - VOICEVOX/
# - voicevox
# - run
#
- name: Create Linux tar.gz
if: startsWith(matrix.artifact_name, 'linux-') # linux
if: startsWith(matrix.artifact_name, 'linux-')
shell: bash
run: |
mv prepackage VOICEVOX
tar cf "${{ matrix.targz_name }}-${{ env.BUILD_IDENTIFIER }}.tar.gz" VOICEVOX/
- name: Show disk space (debug info)
if: startsWith(matrix.artifact_name, 'linux-') # linux
shell: bash
run: |
df -h
tar cfz "${{ matrix.compressed_artifact_name }}-${{ env.BUILD_IDENTIFIER }}.tar.gz" VOICEVOX/
- name: Upload Linux tar.gz artifact
if: startsWith(matrix.artifact_name, 'linux-') # linux
if: startsWith(matrix.artifact_name, 'linux-')
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}-targz
path: "${{ matrix.targz_name }}-${{ env.BUILD_IDENTIFIER }}.tar.gz"
path: "${{ matrix.compressed_artifact_name }}-${{ env.BUILD_IDENTIFIER }}.tar.gz"

- name: Create macOS zip
if: startsWith(matrix.artifact_name, 'macos-')
- name: Create Windows & Mac zip
if: startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')
shell: bash
run: |
mv prepackage VOICEVOX
zip "${{ matrix.zip_name }}.zip" -r VOICEVOX
zip "${{ matrix.compressed_artifact_name }}-${{ env.BUILD_IDENTIFIER }}.zip" -r VOICEVOX
- name: Upload macOS zip artifact
if: startsWith(matrix.artifact_name, 'macos-')
- name: Upload Windows & Mac zip artifact
if: startsWith(matrix.artifact_name, 'windows-') || startsWith(matrix.artifact_name, 'macos-')
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}-zip
path: "${{ matrix.zip_name }}.zip"
path: "${{ matrix.compressed_artifact_name }}-${{ env.BUILD_IDENTIFIER }}.zip"


build-distributable:
Expand Down Expand Up @@ -742,19 +724,19 @@ jobs:
artifact_name:
- linux-nvidia-appimage
- linux-cpu-appimage
- linux-nvidia-prepackage-targz
- linux-cpu-prepackage-targz
- windows-nvidia-nsis-web
- windows-cpu-nsis-web
- windows-nvidia-prepackage-zip
- windows-cpu-prepackage-zip
- macos-cpu-dmg
- macos-cpu-prepackage-zip
include:
- artifact_name: linux-nvidia-appimage
appimage_7z_name: VOICEVOX.AppImage
- artifact_name: linux-cpu-appimage
appimage_7z_name: VOICEVOX-CPU.AppImage
- artifact_name: windows-nvidia-nsis-web
- artifact_name: windows-cpu-nsis-web
- artifact_name: macos-cpu-dmg
- artifact_name: macos-cpu-prepackage-zip

runs-on: ${{ matrix.os }}
steps:
Expand Down Expand Up @@ -853,9 +835,19 @@ jobs:
file_glob: true
file: artifact/*.dmg

# macOS zip
- name: Upload macOS zip to Release assets
if: startsWith(matrix.artifact_name, 'macos-') && endsWith(matrix.artifact_name, '-zip')
# targz
- name: Upload targz to Release assets
if: endsWith(matrix.artifact_name, '-targz')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref }} # == github.event.release.tag_name
file_glob: true
file: artifact/*.tar.gz

# zip
- name: Upload zip to Release assets
if: endsWith(matrix.artifact_name, '-zip')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 2caa341

Please sign in to comment.