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

Linux用実行バイナリ(AppImage)の自動ビルド (#218) #270

Merged
merged 83 commits into from
Oct 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
83 commits
Select commit Hold shift + click to select a range
5abac17
add VOICEVOX_ENGINE_DIR env for electron-builder
aoirint Sep 24, 2021
c089858
add linux electron-builder config
aoirint Sep 24, 2021
deeb711
add workflow
aoirint Sep 24, 2021
465c466
pack VOICEVOX ENGINE
aoirint Sep 24, 2021
12c376d
fix workflow
aoirint Sep 24, 2021
a410904
rm engine archive to free space
aoirint Sep 24, 2021
6196b6c
name steps
aoirint Sep 24, 2021
ed5e2a8
show disk space
aoirint Sep 24, 2021
2ff32f1
update voicevox engine run path for linux
aoirint Sep 24, 2021
afdb4c7
revert linux diff
aoirint Sep 24, 2021
bb548bf
remove original engine after artifact build
aoirint Sep 25, 2021
5c4a728
Merge remote-tracking branch 'origin/main' into patch-build-workflow
aoirint Sep 25, 2021
283e559
env check; empty string or undefined
aoirint Sep 25, 2021
51813fe
fail-fast false
aoirint Sep 25, 2021
2396199
upload win unpacked
aoirint Sep 25, 2021
597b01c
stage build
aoirint Sep 25, 2021
3ffdd9b
prepackaged
aoirint Sep 25, 2021
8448c06
fix prepackage
aoirint Sep 25, 2021
460ff2a
add disk space disp
aoirint Sep 25, 2021
5776d28
merge nsis-web artifact
aoirint Sep 25, 2021
cce5bb0
engine-prepackage
aoirint Sep 25, 2021
f734d96
upload to release
aoirint Sep 25, 2021
6dad7df
fix dir
aoirint Sep 25, 2021
1107ab0
fix merge condition
aoirint Sep 25, 2021
a55a07f
rename job; distributable
aoirint Sep 25, 2021
e99cf4e
fix engine copy
aoirint Sep 25, 2021
c66e598
fix matrix var name
aoirint Sep 25, 2021
e1e869a
fix step name
aoirint Sep 25, 2021
b76a7d9
fix matrix var ref
aoirint Sep 25, 2021
04478e5
add fixme note to rename before upload to asset
aoirint Sep 25, 2021
731179a
disable cpu build
aoirint Sep 25, 2021
b00d807
enable cpu engine prepackage
aoirint Sep 25, 2021
e0607ab
build distributable only on release
aoirint Sep 25, 2021
22f8b52
build on push master
aoirint Sep 25, 2021
0bf2df9
fix commented step name
aoirint Sep 25, 2021
0404799
build on push main
aoirint Sep 25, 2021
7d54077
revert removeOriginalEngine diff
aoirint Sep 26, 2021
09e5dea
temporary use Hiroshiba/voicevox_engine check-2021-09-25
aoirint Sep 26, 2021
cec9dd9
use env to define voicevox engine repo/ver
aoirint Sep 26, 2021
557036c
use env directly (env cannot be used in matrix)
aoirint Sep 26, 2021
90f38af
add noengine-prepackage name and path in matrix
aoirint Sep 26, 2021
5e44627
windows build-workflow diff
aoirint Sep 25, 2021
329ed75
add linux appimage build config
aoirint Sep 24, 2021
b5740d9
add linux matrix
aoirint Sep 26, 2021
ade5ec3
overwrite .env.production for linux
aoirint Sep 26, 2021
af7d55f
appimage build
aoirint Sep 26, 2021
136052f
upload linux appimage to release as splitted archives
aoirint Sep 26, 2021
e2fa3b6
fix listing
aoirint Sep 26, 2021
4bea3d4
fix engine-prepackage artifact name
aoirint Sep 26, 2021
2bfe438
split log
aoirint Sep 26, 2021
3588491
recover file permissions before packaging to AppImage
aoirint Sep 26, 2021
2b3c75a
remove artifact dir layer in asset
aoirint Sep 26, 2021
a30719a
remove linux cpu asset
aoirint Sep 26, 2021
abf79aa
fix recover file permissions
aoirint Sep 26, 2021
43ca785
impl upload-distributable-to-release
aoirint Sep 26, 2021
2e7944c
Merge remote-tracking branch 'origin/main' into patch-build-workflow
aoirint Sep 28, 2021
ad793f9
generate public/licenses.json
aoirint Sep 28, 2021
594bb07
ci licenses.json
aoirint Sep 28, 2021
c375eef
mkdir
aoirint Sep 28, 2021
ec464fe
engine
aoirint Sep 28, 2021
d0b1065
Update build.yml
aoirint Sep 29, 2021
3ef101f
npm ci
aoirint Sep 29, 2021
a9aad84
license: use packageName if name is undefined
aoirint Sep 29, 2021
2c899c1
Merge remote-tracking branch 'origin/main' into patch-build-workflow
aoirint Sep 29, 2021
94b877a
revert packageName substitution
aoirint Sep 29, 2021
dc1731c
skip uploading to release
aoirint Sep 29, 2021
74e7184
parentheses
aoirint Sep 29, 2021
97971e3
add comment
aoirint Sep 29, 2021
5676349
Merge branch 'patch-build-workflow' into patch-linux-build
aoirint Sep 29, 2021
2d19495
env SKIP_UPLOADING_RELEASE_ASSET
aoirint Sep 29, 2021
4267fc2
commonize os matrix
aoirint Sep 29, 2021
fca6c15
Merge branch 'patch-build-workflow' into patch-linux-build
aoirint Sep 29, 2021
1ae84f1
temporarily upload splitted appimage to artifact
aoirint Sep 29, 2021
d692589
fix indent
aoirint Sep 29, 2021
4bf854c
Merge remote-tracking branch 'origin/main' into patch-linux-build
aoirint Sep 29, 2021
04b6b97
Merge remote-tracking branch 'origin/main' into patch-linux-build
aoirint Sep 29, 2021
fe12a29
Merge remote-tracking branch 'origin/main' into patch-linux-build
aoirint Oct 1, 2021
97f5b6c
add tar.gz artifact
aoirint Oct 2, 2021
93c5628
replace github.ref
aoirint Oct 2, 2021
bfa2ca0
add size, hash in list
aoirint Oct 2, 2021
6a4b62f
change engine repo and version
aoirint Oct 2, 2021
5d7153e
swap order
aoirint Oct 2, 2021
2533a04
add comment: tar.gz
aoirint Oct 3, 2021
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
160 changes: 156 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ on:
- created

env:
VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine"
VOICEVOX_ENGINE_VERSION: 0.6.0-aoirint-1
VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine"
VOICEVOX_ENGINE_VERSION: check-2021-09-29

# FIXME: implement build with production resources in Hiroshiba/voicevox
# Temporarily, skip uploading to GitHub Release (use Artifact instead)
Expand All @@ -27,8 +27,12 @@ jobs:
fail-fast: false
matrix:
artifact_name:
- linux-noengine-prepackage
- windows-noengine-prepackage
include:
- artifact_name: linux-noengine-prepackage
artifact_path: dist_electron/linux-unpacked
os: ubuntu-18.04
- artifact_name: windows-noengine-prepackage
artifact_path: dist_electron/win-unpacked
os: windows-2019
Expand Down Expand Up @@ -75,6 +79,18 @@ jobs:
shell: bash
run: npm ci

- name: Show disk space (debug info)
shell: bash
run: |
df -h

- name: Overwrite .env.production for Linux
if: startsWith(matrix.os, 'ubuntu-')
shell: bash
run: |
echo "ENGINE_PATH=./run" > .env.production
echo "VUE_APP_ENGINE_URL=http://127.0.0.1:50021" >> .env.production

- name: Generate public/licenses.json
shell: bash
run: npm run license:generate -- -o public/licenses.json
Expand Down Expand Up @@ -112,9 +128,19 @@ jobs:
# - ${{ env.VOICEVOX_ENGINE_VERSION }}
os: [ubuntu-18.04]
artifact_name:
- linux-cpu-prepackage
- linux-nvidia-prepackage
- windows-cpu-prepackage
- windows-nvidia-prepackage
include:
- artifact_name: linux-cpu-prepackage
noengine_artifact_name: linux-noengine-prepackage
voicevox_engine_asset_name: linux-cpu
os: ubuntu-18.04
- artifact_name: linux-nvidia-prepackage
noengine_artifact_name: linux-noengine-prepackage
voicevox_engine_asset_name: linux-nvidia
os: ubuntu-18.04
- artifact_name: windows-cpu-prepackage
noengine_artifact_name: windows-noengine-prepackage
voicevox_engine_asset_name: windows-cpu
Expand Down Expand Up @@ -170,8 +196,8 @@ jobs:
mkdir -p voicevox_engine/download

# NOTE: VOICEVOX ENGINE should not be cached since it has a size of several GB
# and actions/cache has a limit of 5GB per repository.
# https://github.com/actions/cache#cache-limits
# and actions/cache has a limit of 5GB per repository.
# https://github.com/actions/cache#cache-limits
# - name: Dump VOICEVOX ENGINE repo URL to calc hash
# shell: bash
# run: |
Expand Down Expand Up @@ -239,6 +265,52 @@ jobs:
path: |
prepackage/

- name: Recover file permissions
if: startsWith(matrix.artifact_name, 'linux-') # linux
shell: bash
run: |
chmod +x prepackage/voicevox
chmod +x prepackage/run
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved

- 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
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
if: startsWith(matrix.artifact_name, 'linux-') # linux
shell: bash
run: |
mv prepackage VOICEVOX
tar cf voicevox-${{ env.BUILD_IDENTIFIER }}.tar.gz VOICEVOX/

- name: Show disk space (debug info)
if: startsWith(matrix.artifact_name, 'linux-') # linux
shell: bash
run: |
df -h

- name: Upload Linux tar.gz artifact
if: startsWith(matrix.artifact_name, 'linux-') # linux
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}-targz
path: voicevox-${{ env.BUILD_IDENTIFIER }}.tar.gz


build-distributable:
if: github.event.release.tag_name != '' # If release
Expand All @@ -252,9 +324,17 @@ jobs:
fail-fast: false
matrix:
artifact_name:
# - linux-cpu-appimage
- linux-nvidia-appimage
# - windows-cpu-nsis-web
- windows-nvidia-nsis-web
include:
# - artifact_name: linux-cpu-appimage
# engine_artifact_name: linux-cpu-prepackage
# os: ubuntu-18.04
- artifact_name: linux-nvidia-appimage
engine_artifact_name: linux-nvidia-prepackage
os: ubuntu-18.04
# - artifact_name: windows-cpu-nsis-web
# engine_artifact_name: windows-cpu-prepackage
# os: windows-2019
Expand All @@ -272,6 +352,13 @@ jobs:
name: ${{ matrix.engine_artifact_name }}
path: ./prepackage

- name: Recover file permissions
if: endsWith(matrix.artifact_name, '-appimage') # linux
shell: bash
run: |
chmod +x prepackage/voicevox
chmod +x prepackage/run

- name: Show disk space (debug info)
shell: bash
run: |
Expand Down Expand Up @@ -330,6 +417,14 @@ jobs:
run: |
df -h

- name: Upload Linux AppImage artifact
if: endsWith(matrix.artifact_name, '-appimage')
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}
path: |
dist_electron/*.AppImage

- name: Upload Windows NSIS Web artifact
if: endsWith(matrix.artifact_name, '-nsis-web')
uses: actions/upload-artifact@v2
Expand All @@ -348,9 +443,13 @@ jobs:
matrix:
os: [ubuntu-18.04]
artifact_name:
# - linux-cpu-appimage
- linux-nvidia-appimage
# - windows-cpu-nsis-web
- windows-nvidia-nsis-web
include:
# - artifact_name: linux-cpu-appimage
- artifact_name: linux-nvidia-appimage
# - artifact_name: windows-cpu-nsis-web
- artifact_name: windows-nvidia-nsis-web

Expand All @@ -369,6 +468,59 @@ jobs:
run: |
df -h

# Linux AppImage
- name: Install dependencies for Linux AppImage Upload
if: endsWith(matrix.artifact_name, '-appimage')
shell: bash
run: |
sudo apt-get update
sudo apt-get install -y p7zip-full

- name: Split AppImage artifact
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
if: endsWith(matrix.artifact_name, '-appimage')
shell: bash
run: |
cd artifact/

for appImageFile in *.AppImage; do
echo "Splitting ${appImageFile}"

# compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ...
7z -v1g a "${appImageFile}.7z" "${appImageFile}"

# Output splitted archive name<TAB>size<TAB>hash list to myartifact.7z.txt
ls ${appImageFile}.7z.* > archives_name.txt
stat --printf="%s\n" *.7z.* > archives_size.txt
md5sum *.7z.* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt

paste -d '\t' archives_name.txt archives_size.txt archives_hash.txt > archives.txt

mv archives.txt "${{ matrix.artifact_name }}.7z.txt"
done

- name: Show disk space (debug info)
if: endsWith(matrix.artifact_name, '-appimage')
shell: bash
run: |
df -h

- name: Upload Linux AppImage Release artifact
if: env.SKIP_UPLOADING_RELEASE_ASSET == '1' && endsWith(matrix.artifact_name, '-appimage')
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.artifact_name }}-release
path: |
artifact/*.7z.*

- name: Upload Linux AppImage splitted archives to Release assets
if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && endsWith(matrix.artifact_name, '-appimage')
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/*.7z.*

# Windows NSIS Web
# FIXME: rename archives and installer before upload to separate cpu, gpu distribution
- name: Upload Windows nsis-web archives to Release assets
Expand Down
10 changes: 10 additions & 0 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ module.exports = {
repo: "voicevox",
vPrefixedTagName: false,
},
linux: {
icon: "public/icon.png",
category: "AudioVideo",
target: [
{
target: "AppImage",
arch: ["x64"],
},
],
},
},
},
},
Expand Down