Skip to content

Make a Release

Make a Release #186

name: Make a Release
on:
workflow_dispatch:
inputs:
tag:
description: 'which tag to create and release?'
required: true
default: 'nightly'
model-tags:
description: 'which tag(s) of model release to use? (comma-separated list of tags)'
required: true
default: 'model-20211209, model-20220923'
ext-model-tags:
description: 'which tag(s) of external model release to use?'
required: true
default: 'external-models'
contrib-model-tags:
description: 'which tag(s) of contributed model release to use?'
required: true
default: 'contrib-models'
ov_tag:
description: 'which tag of openvino to use'
required: true
default: 'latest'
type: string
ncnn_tag:
description: 'which tag of ncnn to use'
required: true
default: 'latest'
type: string
jobs:
build-vsov:
uses: ./.github/workflows/windows-ov.yml
with:
tag: ${{ github.event.inputs.tag }}
ov_tag: ${{ github.event.inputs.ov_tag }}
build-vsort:
uses: ./.github/workflows/windows-ort.yml
with:
tag: ${{ github.event.inputs.tag }}
build-vstrt:
uses: ./.github/workflows/windows-trt.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-vsncnn:
uses: ./.github/workflows/windows-ncnn.yml
with:
tag: ${{ github.event.inputs.tag }}
ncnn_tag: ${{ github.event.inputs.ncnn_tag }}
build-cuda-dependency:
uses: ./.github/workflows/windows-cuda-dependency.yml
with:
tag: ${{ github.event.inputs.tag }}
secrets:
REPO_TOKEN: ${{ secrets.REPO_TOKEN }}
build-scripts:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Compress scirpts.7z
run: |
cd scripts
7za a -t7z -bb3 -mx=9 ../scripts.${{ github.event.inputs.tag }}.7z .
- name: Upload scripts release
uses: actions/upload-artifact@v3
with:
name: Scripts
path: scripts
retention-days: 1
- name: Release scripts
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
files: scripts.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
build-models:
runs-on: ubuntu-latest
steps:
- name: Download Models
run: |
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
test -f "dl.7z"
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../models.7z .
- name: Upload model release
uses: actions/upload-artifact@v3
with:
name: Models
path: release
retention-days: 1
- name: Download External Models
run: |
rm -rf release
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.ext-model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
test -f "dl.7z"
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../ext-models.7z .
- name: Upload external model release
uses: actions/upload-artifact@v3
with:
name: External-Models
path: release
retention-days: 1
- name: Download Contributed Models
run: |
rm -rf release
set -ex
mkdir -p release/models
cd release
pushd models
for tag in $(echo "${{ github.event.inputs.contrib-model-tags }}" | tr ',' ' '); do
echo "Handling tag $tag"
curl -s https://api.github.com/repos/AmusementClub/vs-mlrt/releases/tags/"$tag" > release.json
for url in $(cat release.json | jq '.assets | .[] | .url ' | tr -d '"'); do
echo "Downloading $url"
curl -o dl.7z -LJ -H 'Accept: application/octet-stream' "$url"
# later release should overwrite earlier ones
7za x -y dl.7z
done
#test -f "dl.7z" # contrib-models might be empty.
rm -f dl.7z release.json
done
popd
ls -lR
du -sh
7za a -t7z -bb3 -mx=9 ../contrib-models.7z .
- name: Upload contrib model release
uses: actions/upload-artifact@v3
with:
name: Contrib-Models
path: release
retention-days: 1
- name: Rename release asset
run: |
mv models.7z models.${{ github.event.inputs.tag }}.7z
mv ext-models.7z ext-models.${{ github.event.inputs.tag }}.7z
mv contrib-models.7z contrib-models.${{ github.event.inputs.tag }}.7z
- name: Release models
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
files: |
models.${{ github.event.inputs.tag }}.7z
ext-models.${{ github.event.inputs.tag }}.7z
contrib-models.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
release:
runs-on: ubuntu-latest
needs: [build-vsov, build-vsort, build-vstrt, build-vsncnn, build-cuda-dependency, build-scripts, build-models]
defaults:
run:
shell: bash
steps:
- name: Download artifact for scripts
uses: actions/download-artifact@v3
with:
name: Scripts
path: scripts-release
- name: Download artifact for models
uses: actions/download-artifact@v3
with:
name: Models
path: models-release
- name: Download artifact for vsov
uses: actions/download-artifact@v3
with:
name: VSOV-Windows-x64
path: vsov-release
- name: Download artifact for vsort
uses: actions/download-artifact@v3
with:
name: VSORT-Windows-x64
path: vsort-release
- name: Download artifact for vstrt
uses: actions/download-artifact@v3
with:
name: VSTRT-Windows-x64
path: vstrt-release
- name: Download artifact for vsncnn
uses: actions/download-artifact@v3
with:
name: VSNCNN-GPU-Windows-x64
path: vsncnn-release
- name: Download artifact for cuda dependencies
uses: actions/download-artifact@v3
with:
name: vsmlrt-cuda
path: cuda-release
- name: Build CPU-only release
shell: bash
run: |
mkdir release-cpu
cp -r models-release/models release-cpu/
cp -r vsov-release/* release-cpu/
cp -r vsort-release/* release-cpu/
rm -f release-cpu/vsort/onnxruntime_providers_*.dll
cp scripts-release/*.py release-cpu/
cd release-cpu
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-cpu.7z .
- name: Upload CPU-only release
uses: actions/upload-artifact@v3
if: false
with:
name: vsmlrt-cpu-release
path: vsmlrt-windows-x64-cpu.7z
retention-days: 1
- name: Rename release asset
run: mv vsmlrt-windows-x64-cpu.7z vsmlrt-windows-x64-cpu.${{ github.event.inputs.tag }}.7z
- name: Release CPU
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-cpu.${{ github.event.inputs.tag}}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Build generic GPU release
shell: bash
run: |
mkdir release-generic-gpu
cp -r models-release/models release-generic-gpu/
cp -r vsov-release/* release-generic-gpu/
cp -r vsort-release/* release-generic-gpu/
rm -f release-generic-gpu/vsort/onnxruntime_providers_*.dll
cp -r vsncnn-release/* release-generic-gpu/
cp scripts-release/*.py release-generic-gpu/
cd release-generic-gpu
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-generic-gpu.7z .
- name: Upload generic GPU release
uses: actions/upload-artifact@v3
if: false
with:
name: vsmlrt-generic-gpu-release
path: vsmlrt-windows-x64-generic-gpu.7z
retention-days: 1
- name: Rename release asset for generic GPU release
run: mv vsmlrt-windows-x64-generic-gpu.7z vsmlrt-windows-x64-generic-gpu.${{ github.event.inputs.tag }}.7z
- name: Release generic GPU
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-generic-gpu.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
- name: Extract CUDA libraries
run: |
cd cuda-release
7za x -bb3 vsmlrt-cuda.7z
rm vsmlrt-cuda.7z
- name: Build CUDA release
shell: bash
run: |
mkdir release-cuda
cp -r models-release/models release-cuda/
cp -r vsov-release/* release-cuda/
cp -r vsort-release/* release-cuda/
cp -r vstrt-release/* release-cuda/
cp -r vsncnn-release/* release-cuda/
cp -r cuda-release/* release-cuda/
cp scripts-release/*.py release-cuda/
cd release-cuda
ls -lR
7za a -t7z -bb3 -mx=9 ../vsmlrt-windows-x64-cuda.7z .
- name: Upload CUDA release
uses: actions/upload-artifact@v3
if: false
with:
name: vsmlrt-cuda-release
path: vsmlrt-windows-x64-cuda.7z
retention-days: 1
- name: Rename release asset
run: mv vsmlrt-windows-x64-cuda.7z vsmlrt-windows-x64-cuda.${{ github.event.inputs.tag }}.7z
- name: Release CUDA
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ github.event.inputs.tag }}
files: vsmlrt-windows-x64-cuda.${{ github.event.inputs.tag }}.7z
fail_on_unmatched_files: true
generate_release_notes: false
prerelease: true
# Update nightly tag.
- name: Checkout repo
if: github.event.inputs.tag == 'nightly'
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Overwrite tag
if: github.event.inputs.tag == 'nightly'
run: |
git pull --tags --force
git tag -f ${{ github.event.inputs.tag }}
git push -f origin ${{ github.event.inputs.tag }}