-
Notifications
You must be signed in to change notification settings - Fork 153
41 lines (40 loc) · 2.17 KB
/
build-windows.yml
File metadata and controls
41 lines (40 loc) · 2.17 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
name: build-windows
on:
workflow_dispatch: null
jobs:
build-windows:
name: Build StemRoller for Windows
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
with:
ref: main
- uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm i -D
- run: npm run download-third-party-apps
- run: npm run build:win
- uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- run: Rename-Item dist\win-unpacked -NewName stemroller-${{ steps.package-version.outputs.version }}-win-cuda
- run: Invoke-WebRequest -Uri https://www.7-zip.org/a/7zr.exe -OutFile 7zr.exe
- run: Invoke-WebRequest -Uri https://www.7-zip.org/a/7z2409-x64.exe -OutFile 7zInstaller-x64.exe
- run: .\7zr.exe x "7zInstaller-x64.exe"
- run: move "dist\stemroller-${{ steps.package-version.outputs.version }}-win-cuda" "stemroller-${{ steps.package-version.outputs.version }}-win-cuda"
- run: .\7z.exe a -m0=lzma2 -mmt=on -mx=9 -sfx"7z.sfx" "stemroller-${{ steps.package-version.outputs.version }}-win-cuda.exe" "stemroller-${{ steps.package-version.outputs.version }}-win-cuda"
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: python -m pip install --upgrade pip huggingface_hub
- name: Upload artifact to Hugging Face Hub
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
HF_REPO_ID: ${{ vars.HF_REPO_ID || secrets.HF_REPO_ID }}
HF_REPO_TYPE: ${{ vars.HF_REPO_TYPE || secrets.HF_REPO_TYPE }}
run: |
if (-not $env:HF_TOKEN) { throw "HF_TOKEN secret is not set" }
if (-not $env:HF_REPO_ID) { throw "HF_REPO_ID is not set (add Actions variable HF_REPO_ID, or secret HF_REPO_ID)" }
if (-not $env:HF_REPO_TYPE) { $env:HF_REPO_TYPE = "model" }
hf upload $env:HF_REPO_ID "stemroller-${{ steps.package-version.outputs.version }}-win-cuda.exe" "stemroller-${{ steps.package-version.outputs.version }}-win-cuda.exe" --repo-type $env:HF_REPO_TYPE --token $env:HF_TOKEN --commit-message "Upload Windows artifact for ${{ steps.package-version.outputs.version }}"