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

バイナリビルドCI: 7zとVVPPが同時にCIストレージ容量を消費しないようにする #696

Merged
merged 8 commits into from
Jun 20, 2023
51 changes: 44 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ jobs:
if [[ ${{ matrix.os }} == windows-* ]]; then
mv "${CUDA_ROOT}/bin/"*.dll download/cuda/bin/

# remove CUDA to reduce disk usage
rm -rf "${CUDA_ROOT}"
else
cp "${CUDA_ROOT}/lib64/"libcublas.so.* download/cuda/bin/
Expand All @@ -166,6 +167,9 @@ jobs:
rm -f download/cuda/bin/libcufft.so.*.*
rm -f download/cuda/bin/libcurand.so.*.*
rm -f download/cuda/bin/libcudart.so.*.*.*

# remove CUDA to reduce disk usage
sudo rm -rf "${CUDA_ROOT}"
fi

# Download cuDNN
Expand Down Expand Up @@ -499,13 +503,50 @@ jobs:
CERT_BASE64: ${{ secrets.CERT_BASE64 }}
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}

- name: Rearchive and split artifact
- name: Rename artifact directory to archive
run: |
mv dist/run/ "${{ matrix.target }}/"

# 7z archives
- name: Create 7z archives
shell: bash
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
run: |
# Compress to artifact.7z.001, artifact.7z.002, ...
7z -r -v1900m a "${{ steps.vars.outputs.package_name }}.7z" "${{ matrix.target }}/"

# Output splitted archive list
ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt
mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt"

- name: Upload 7z archives to artifact
if: github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.vars.outputs.package_name }}
path: |
${{ steps.vars.outputs.package_name }}.7z.*

- name: Upload 7z archives to Release assets
if: needs.config.outputs.version != ''
uses: ncipollo/release-action@v1
with:
allowUpdates: true
prerelease: ${{ github.event.inputs.prerelease }}
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.config.outputs.version }}
artifacts: >
${{ steps.vars.outputs.package_name }}.7z.*
commit: ${{ github.sha }}

- name: Clean 7z archives to reduce disk usage
shell: bash
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
run: |
rm -f ${{ steps.vars.outputs.package_name }}.7z.*

# VVPP archives
- name: Create VVPP archives
shell: bash
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
run: |
# Compress to artifact.001.vvppp,artifact.002.vvppp, ...
(cd "${{ matrix.target }}" && 7z -r a "../compressed.zip")
split -b 1900M --numeric-suffixes=1 -a 3 --additional-suffix .vvppp ./compressed.zip ./${{ steps.vars.outputs.package_name }}.
Expand All @@ -516,23 +557,20 @@ jobs:
fi

# Output splitted archive list
ls ${{ steps.vars.outputs.package_name }}.7z.* > archives_7z.txt
mv archives_7z.txt "${{ steps.vars.outputs.package_name }}.7z.txt"
ls ${{ steps.vars.outputs.package_name }}*.vvppp ${{ steps.vars.outputs.package_name }}.vvpp > archives_vvpp.txt || true
mv archives_vvpp.txt "${{ steps.vars.outputs.package_name }}.vvpp.txt"

- name: Upload to artifact
- name: Upload VVPP archives to artifact
if: github.event.inputs.upload_artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.vars.outputs.package_name }}
path: |
${{ steps.vars.outputs.package_name }}.7z.*
${{ steps.vars.outputs.package_name }}.vvpp
${{ steps.vars.outputs.package_name }}*.vvppp
${{ steps.vars.outputs.package_name }}.vvpp.txt

- name: Upload to Release assets
- name: Upload VVPP archives to Release assets
if: needs.config.outputs.version != ''
uses: ncipollo/release-action@v1
with:
Expand All @@ -541,7 +579,6 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ needs.config.outputs.version }}
artifacts: >
${{ steps.vars.outputs.package_name }}.7z.*,
${{ steps.vars.outputs.package_name }}.vvpp,
${{ steps.vars.outputs.package_name }}*.vvppp,
${{ steps.vars.outputs.package_name }}.vvpp.txt
Expand Down