-
Notifications
You must be signed in to change notification settings - Fork 152
42 lines (41 loc) · 1.65 KB
/
build-mac.yml
File metadata and controls
42 lines (41 loc) · 1.65 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
name: build-mac
on:
workflow_dispatch: null
jobs:
build-mac:
name: Build StemRoller for macOS
runs-on: macos-15-intel
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:mac
- uses: tyankatsu0105/read-package-version-actions@v1
id: package-version
- run: ditto -c -k --sequesterRsrc --keepParent dist/mac/StemRoller.app stemroller-${{ steps.package-version.outputs.version }}-mac.zip
- 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 [ -z "$HF_TOKEN" ]; then
echo "HF_TOKEN secret is not set" >&2
exit 1
fi
if [ -z "$HF_REPO_ID" ]; then
echo "HF_REPO_ID is not set (add Actions variable HF_REPO_ID, or secret HF_REPO_ID)" >&2
exit 1
fi
REPO_TYPE="${HF_REPO_TYPE:-model}"
hf upload "$HF_REPO_ID" "stemroller-${{ steps.package-version.outputs.version }}-mac.zip" "stemroller-${{ steps.package-version.outputs.version }}-mac.zip" --repo-type "$REPO_TYPE" --token "$HF_TOKEN" --commit-message "Upload macOS artifact for ${{ steps.package-version.outputs.version }}"