Skip to content

Commit 7036f21

Browse files
committed
first attempt
1 parent 34891cf commit 7036f21

File tree

4 files changed

+86
-18
lines changed

4 files changed

+86
-18
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Pack Tutorials
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
7+
jobs:
8+
zip_and_upload:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Set up environment variables
18+
id: env_setup
19+
run: |
20+
echo "SOURCE_FOLDER_PATH=docs/notebooks" >> $GITHUB_ENV
21+
echo "TARGET_FOLDER_NAME=data_designer_tutorial" >> $GITHUB_ENV
22+
echo "ZIP_FILE_NAME=data_designer_tutorial" >> $GITHUB_ENV
23+
24+
- name: Check if source folder exists
25+
run: |
26+
if [ ! -d "${{ env.SOURCE_FOLDER_PATH }}" ]; then
27+
echo "::error::Source Folder '${{ env.SOURCE_FOLDER_PATH }}' not found. Check the input value."
28+
exit 1
29+
fi
30+
31+
- name: Rename source folder
32+
run: mv ${{ env.SOURCE_FOLDER_PATH }} ${{ env.TARGET_FOLDER_NAME }}
33+
34+
- name: Zip the target folder
35+
run: |
36+
zip -r ${{ env.ZIP_FILE_NAME }} ${{ env.TARGET_FOLDER_NAME }}
37+
echo "Successfully created ${{ env.ZIP_FILE_NAME }}"
38+
39+
- name: Find the latest existing release Tag
40+
id: get_release
41+
run: |
42+
gh auth status || echo "GitHub CLI is not authenticated, relying on GITHUB_TOKEN."
43+
44+
# We use tr -d '\n' to remove the trailing newline for a clean tag string
45+
LATEST_TAG=$(gh release view --json tagName -q .tagName 2>/dev/null)
46+
47+
if [ -z "$LATEST_TAG" ]; then
48+
echo "::error::Could not find the latest published release tag. Ensure a release exists."
49+
exit 1
50+
fi
51+
52+
echo "Latest Release Tag found: $LATEST_TAG"
53+
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
57+
- name: Upload zip file as release asset
58+
uses: softprops/action-gh-release@v2
59+
with:
60+
tag_name: ${{ steps.get_release.outputs.tag }}
61+
files: ${{ env.ZIP_FILE_NAME }}
62+
draft: false
63+
prerelease: false
64+
65+
- name: Cleanup
66+
if: always()
67+
run: rm -f ${{ env.ZIP_FILE_NAME }}
Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,15 @@ Welcome to the Data Designer tutorial series! These hands-on notebooks will guid
66

77
### Local Setup Best Practices
88

9-
The notebooks can be downloaded using the link on the top of each of them.
9+
First, download the tutorial [from the release assets](add-link).
1010
To run them locally, we recommend using a virtual environment to manage dependencies:
1111

1212
=== "uv (Recommended)"
1313

1414
```bash
15-
# Create a new project directory
16-
mkdir data-designer-tutorials
17-
cd data-designer-tutorials
18-
19-
# Initialize a new uv project
20-
uv init
21-
22-
# Add data-designer and jupyter
23-
uv add data-designer jupyter
15+
# Extract tutorial notebooks
16+
unzip data_designer_tutorial.zip
17+
cd data_designer_tutorial
2418

2519
# Launch Jupyter
2620
uv run jupyter notebook
@@ -29,15 +23,13 @@ To run them locally, we recommend using a virtual environment to manage dependen
2923
=== "pip + venv"
3024

3125
```bash
32-
# Create a new project directory
33-
mkdir data-designer-tutorials
34-
cd data-designer-tutorials
26+
# Extract tutorial notebooks
27+
unzip data_designer_tutorial.zip
28+
cd data_designer_tutorial
3529

36-
# Create and activate a virtual environment
30+
# Create Python virtual environment and install required packages
3731
python -m venv venv
3832
source venv/bin/activate
39-
40-
# Install data-designer and jupyter
4133
pip install data-designer jupyter
4234

4335
# Launch Jupyter
@@ -117,4 +109,4 @@ Quick reference guides for the main configuration objects:
117109
- **[column_configs](../code_reference/column_configs.md)** - All column configuration types
118110
- **[config_builder](../code_reference/config_builder.md)** - The `DataDesignerConfigBuilder` API
119111
- **[data_designer_config](../code_reference/data_designer_config.md)** - Main configuration schema
120-
- **[validator_params](../code_reference/validator_params.md)** - Validator configuration options
112+
- **[validator_params](../code_reference/validator_params.md)** - Validator configuration options

docs/notebooks/pyproject.toml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[project]
2+
name = "data_designer_tutorial"
3+
version = "0.1.0"
4+
readme = "README.md"
5+
requires-python = ">=3.11"
6+
dependencies = [
7+
"data-designer==0.1.0",
8+
"jupyter>=1.1.1",
9+
]

mkdocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ nav:
1717
- Model Providers: models/model-providers.md
1818
- Model Configs: models/model-configs.md
1919
- Tutorials:
20-
- Overview: notebooks/intro.md
20+
- Overview: notebooks/README.md
2121
- The Basics: notebooks/1-the-basics.ipynb
2222
- Structured Outputs and Jinja Expressions: notebooks/2-structured-outputs-and-jinja-expressions.ipynb
2323
- Seeding with an External Dataset: notebooks/3-seeding-with-a-dataset.ipynb

0 commit comments

Comments
 (0)