build-mac #34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: build-mac | |
| on: | |
| workflow_dispatch: null | |
| jobs: | |
| build-mac: | |
| name: Build StemRoller for macOS | |
| runs-on: macos-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: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 }} | |
| HF_REPO_TYPE: ${{ vars.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 variable is not set" >&2 | |
| exit 1 | |
| fi | |
| REPO_TYPE="${HF_REPO_TYPE:-model}" | |
| huggingface-cli 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 }}" |