forked from adefossez/demucs
-
Notifications
You must be signed in to change notification settings - Fork 6
66 lines (59 loc) · 1.88 KB
/
Copy pathrelease.yml
File metadata and controls
66 lines (59 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: release
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
permissions:
contents: write # Fetch code (actions/checkout), create release
packages: write # Upload and publish packages to GitHub Packages
jobs:
build:
runs-on: ubuntu-latest
if: ${{ github.repository == 'mixxxdj/demucs' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v5
with:
python-version: 3.13
- uses: actions/cache@v4
with:
path: env
key: build-${{ hashFiles('**/requirements.txt') }}
- run: |
set -eo pipefail
echo "VERSION=$(git describe --tags --match "v*" --exclude "*-onnxmodel")-onnxmodel" >> "${GITHUB_ENV}"
name: "Prepare"
- run: |
python3 -m venv env
. env/bin/activate
pip install .
pip install onnx onnxruntime
./scripts/convert-pth-to-onnx.py ./output
name: Build
- run: |
if ! gh release view --repo "${{ github.repository }}" "${RELEASE_NAME}" &> /dev/null
then
gh release create --repo "${{ github.repository }}" "${RELEASE_NAME}" \
--generate-notes \
--latest \
--target "${{ github.sha }}"
gh release upload --repo "${{ github.repository }}" "${RELEASE_NAME}" output/htdemucs.onnx
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RELEASE_NAME: ${{ env.VERSION }}
shell: bash
if: ${{ github.event_name == 'push' }}
id: ghrelease
name: "Creates a release in GitHub if it doesn't exist yet"
- name: Upload GitHub Actions artifacts
if: ${{ steps.ghrelease.outcome == 'skipped' }}
uses: actions/upload-artifact@v4
with:
name: htdemucs.onnx
path: |
./output/htdemucs.onnx