Spaces:
Running
Running
ci: make sure to only push to hf when release was done
Browse files- .github/workflows/hf-space.yml +0 -2
- .github/workflows/release.yml +59 -17
.github/workflows/hf-space.yml
CHANGED
@@ -1,7 +1,5 @@
|
|
1 |
name: Sync to Hugging Face space
|
2 |
on:
|
3 |
-
push:
|
4 |
-
branches: [main]
|
5 |
workflow_dispatch:
|
6 |
|
7 |
jobs:
|
|
|
1 |
name: Sync to Hugging Face space
|
2 |
on:
|
|
|
|
|
3 |
workflow_dispatch:
|
4 |
|
5 |
jobs:
|
.github/workflows/release.yml
CHANGED
@@ -1,50 +1,92 @@
|
|
1 |
-
name: Release
|
2 |
|
3 |
on:
|
4 |
push:
|
5 |
-
branches:
|
6 |
-
|
7 |
-
|
8 |
-
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
9 |
|
10 |
permissions:
|
11 |
contents: write
|
12 |
pull-requests: write
|
13 |
|
|
|
|
|
14 |
jobs:
|
15 |
release:
|
16 |
-
name: Release
|
17 |
runs-on: ubuntu-latest
|
|
|
|
|
|
|
18 |
steps:
|
19 |
- name: Checkout Repo
|
20 |
uses: actions/checkout@v4
|
21 |
|
22 |
-
- name: Setup pnpm
|
23 |
-
uses: pnpm/action-setup@v4
|
24 |
-
with:
|
25 |
-
version: latest
|
26 |
-
|
27 |
- name: Setup Node.js
|
28 |
uses: actions/setup-node@v4
|
29 |
with:
|
30 |
node-version: 18
|
31 |
cache: "pnpm"
|
32 |
|
|
|
|
|
|
|
|
|
|
|
33 |
- name: Install Dependencies
|
34 |
-
run: pnpm install --frozen-lockfile
|
35 |
|
36 |
-
- name: Build
|
37 |
-
run: pnpm
|
38 |
|
39 |
-
- name: Create Release Pull Request or Publish to
|
40 |
id: changesets
|
41 |
uses: changesets/action@v1
|
42 |
with:
|
43 |
-
# This expects you to have a script called release which does a build for your packages and calls changeset publish
|
44 |
-
publish: pnpm changeset:publish
|
45 |
version: pnpm changeset:version
|
|
|
46 |
commit: "chore: version packages"
|
47 |
title: "chore: version packages"
|
48 |
env:
|
49 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
50 |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
name: Release & Deploy
|
2 |
|
3 |
on:
|
4 |
push:
|
5 |
+
branches: [main]
|
6 |
+
workflow_dispatch:
|
|
|
|
|
7 |
|
8 |
permissions:
|
9 |
contents: write
|
10 |
pull-requests: write
|
11 |
|
12 |
+
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
13 |
+
|
14 |
jobs:
|
15 |
release:
|
16 |
+
name: Release NPM Packages
|
17 |
runs-on: ubuntu-latest
|
18 |
+
outputs:
|
19 |
+
published: ${{ steps.changesets.outputs.published }}
|
20 |
+
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}
|
21 |
steps:
|
22 |
- name: Checkout Repo
|
23 |
uses: actions/checkout@v4
|
24 |
|
|
|
|
|
|
|
|
|
|
|
25 |
- name: Setup Node.js
|
26 |
uses: actions/setup-node@v4
|
27 |
with:
|
28 |
node-version: 18
|
29 |
cache: "pnpm"
|
30 |
|
31 |
+
- name: Setup pnpm
|
32 |
+
uses: pnpm/action-setup@v4
|
33 |
+
with:
|
34 |
+
version: latest
|
35 |
+
|
36 |
- name: Install Dependencies
|
37 |
+
run: pnpm install --no-frozen-lockfile
|
38 |
|
39 |
+
- name: Build Packages
|
40 |
+
run: pnpm run build:all
|
41 |
|
42 |
+
- name: Create Release Pull Request or Publish to NPM
|
43 |
id: changesets
|
44 |
uses: changesets/action@v1
|
45 |
with:
|
|
|
|
|
46 |
version: pnpm changeset:version
|
47 |
+
publish: pnpm changeset:publish
|
48 |
commit: "chore: version packages"
|
49 |
title: "chore: version packages"
|
50 |
env:
|
51 |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
52 |
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
53 |
+
|
54 |
+
deploy-to-hf:
|
55 |
+
name: Deploy to Hugging Face Spaces
|
56 |
+
runs-on: ubuntu-latest
|
57 |
+
needs: release
|
58 |
+
# Only run if packages were actually published (new release)
|
59 |
+
if: needs.release.outputs.published == 'true'
|
60 |
+
steps:
|
61 |
+
- name: Checkout Repo
|
62 |
+
uses: actions/checkout@v4
|
63 |
+
|
64 |
+
- name: Setup Node.js
|
65 |
+
uses: actions/setup-node@v4
|
66 |
+
with:
|
67 |
+
node-version: 18
|
68 |
+
cache: "pnpm"
|
69 |
+
|
70 |
+
- name: Setup pnpm
|
71 |
+
uses: pnpm/action-setup@v4
|
72 |
+
with:
|
73 |
+
version: latest
|
74 |
+
|
75 |
+
- name: Install Dependencies
|
76 |
+
run: pnpm install --no-frozen-lockfile
|
77 |
+
|
78 |
+
- name: Build Cyberpunk Demo
|
79 |
+
run: pnpm run build:cyberpunk
|
80 |
+
|
81 |
+
- name: Deploy to Hugging Face Spaces
|
82 |
+
uses: huggingface/huggingface_hub@main
|
83 |
+
with:
|
84 |
+
from: examples/cyberpunk-standalone/dist
|
85 |
+
to: .
|
86 |
+
space: timpietrusky/lerobot-js
|
87 |
+
token: ${{ secrets.HF_TOKEN }}
|
88 |
+
|
89 |
+
- name: Notify Deployment Success
|
90 |
+
run: |
|
91 |
+
echo "🚀 Successfully deployed to Hugging Face Spaces!"
|
92 |
+
echo "📦 Published packages: ${{ needs.release.outputs.publishedPackages }}"
|