6969
7070 - name : Build dataset
7171 run : |
72- # Build the dataset
73- # Output will be deployed to https://api.openfilamentdatabase.org/
7472 python -m builder.build \
7573 --version "${{ steps.version.outputs.version }}"
7674
@@ -107,136 +105,53 @@ jobs:
107105 id : deployment
108106 uses : actions/deploy-pages@v4
109107
110- # Get the last release tag for generating release notes
111- - name : Get last release tag
112- id : last_release
113- run : |
114- LAST_TAG=$(git tag -l 'dataset-v*' --sort=-version:refname | head -n 1)
115- if [ -z "$LAST_TAG" ]; then
116- echo "previous_tag=" >> $GITHUB_OUTPUT
117- echo "No previous dataset release found"
118- else
119- echo "previous_tag=$LAST_TAG" >> $GITHUB_OUTPUT
120- echo "Last release: $LAST_TAG"
121- fi
122-
123- # Generate release notes with only changes since last release
124- - name : Generate release notes
125- id : release_notes
126- run : |
127- PREVIOUS_TAG="${{ steps.last_release.outputs.previous_tag }}"
128-
129- # Start building release notes
130- cat > release_notes.md << 'EOF'
131- ## Open Filament Database v${{ steps.version.outputs.version }}
132-
133- All paths below are relative to the base API URL: **https://api.openfilamentdatabase.org/**
134-
135- ### Downloads
136-
137- | Format | Description | File |
138- |--------|-------------|------|
139- | **SQLite (Filaments)** | Relational database with full schema | `sqlite/filaments.db` |
140- | **SQLite (Stores)** | Store information database | `sqlite/stores.db` |
141- | **SQLite (compressed)** | XZ compressed SQLite files | `sqlite/*.db.xz` |
142- | **JSON** | Complete dataset in one file | `json/all.json` |
143- | **JSON (compressed)** | Gzipped JSON | `json/all.json.gz` |
144- | **NDJSON** | Newline-delimited JSON for streaming | `json/all.ndjson` |
145- | **CSV** | Multiple CSV files | `csv/` directory |
146-
147- ### API Endpoints
148-
149- All endpoints are relative to: **https://api.openfilamentdatabase.org/**
150-
151- #### Brands & Filaments
152- - `api/v1/index.json` - API root with version and stats
153- - `api/v1/brands/index.json` - List of all brands
154- - `api/v1/brands/{slug}/index.json` - Individual brand with materials
155- - `api/v1/brands/{slug}/materials/{material_slug}/index.json` - Material with filaments
156- - `api/v1/brands/{slug}/materials/{material_slug}/filaments/{filament_slug}/index.json` - Filament with variants
157- - `api/v1/brands/{slug}/materials/{material_slug}/filaments/{filament_slug}/variants/{variant_slug}.json` - Variant details with sizes
158-
159- #### Stores
160- - `api/v1/stores/index.json` - List of stores
161- - `api/v1/stores/{slug}.json` - Individual store details
162-
163- #### Logos
164- - `api/v1/brands/logo/index.json` - List of all brand logos
165- - `api/v1/brands/logo/{logo_id}.json` - Brand logo metadata
166- - `api/v1/brands/logo/{logo_id}.{ext}` - Brand logo image file
167- - `api/v1/stores/logo/index.json` - List of all store logos
168- - `api/v1/stores/logo/{logo_id}.json` - Store logo metadata
169- - `api/v1/stores/logo/{logo_id}.{ext}` - Store logo image file
170-
171- #### Schemas
172- - `api/v1/schemas/index.json` - List of available JSON schemas
173- - `api/v1/schemas/{name}.json` - Individual JSON schema
174-
175- ### Direct Downloads
176-
177- All paths relative to: **https://api.openfilamentdatabase.org/**
178-
179- - `json/all.json` - Complete dataset
180- - `sqlite/filaments.db` - SQLite database (filaments)
181- - `sqlite/stores.db` - SQLite database (stores)
182- - `csv/` - CSV files
183-
184- ### Checksums
185-
186- See `manifest.json` for SHA256 checksums of all files.
187-
188- EOF
189-
190- # Add changes section only if there was a previous release
191- if [ -n "$PREVIOUS_TAG" ]; then
192- echo "" >> release_notes.md
193- echo "### Changes Since $PREVIOUS_TAG" >> release_notes.md
194- echo "" >> release_notes.md
195-
196- # Verify tag exists before running git log
197- if git rev-parse "$PREVIOUS_TAG" >/dev/null 2>&1; then
198- # Get commit log since last release, using -- to separate paths from revisions
199- if git log "$PREVIOUS_TAG..HEAD" --oneline --no-merges -- data/ stores/ builder/ schemas/ > commits.txt 2>/dev/null; then
200- if [ -s commits.txt ]; then
201- # Group changes by type
202- echo "#### Recent Updates" >> release_notes.md
203- echo "" >> release_notes.md
204- while read line; do
205- echo "- $line" >> release_notes.md
206- done < commits.txt
207- else
208- echo "- Infrastructure and maintenance updates" >> release_notes.md
209- fi
210- else
211- echo "- Unable to retrieve commit history" >> release_notes.md
212- fi
213- else
214- echo "- First release or previous tag not found" >> release_notes.md
215- fi
216- fi
217-
218- # Set output
219- echo "notes_file=release_notes.md" >> $GITHUB_OUTPUT
220-
221108 # Create Release
222109 - name : Create Release
223110 uses : softprops/action-gh-release@v2
224111 with :
225112 tag_name : dataset-v${{ steps.version.outputs.version }}
226113 name : Dataset v${{ steps.version.outputs.version }}
227- body_path : release_notes.md
114+ body : |
115+ ## Open Filament Database v${{ steps.version.outputs.version }}
116+
117+ ### Downloads
118+
119+ | Format | Description | File |
120+ |--------|-------------|------|
121+ | **SQLite** | Relational database with full schema | `filaments.db` |
122+ | **SQLite (compressed)** | XZ compressed SQLite | `filaments.db.xz` |
123+ | **JSON** | Complete dataset in one file | `all.json` |
124+ | **JSON (compressed)** | Gzipped JSON | `all.json.gz` |
125+ | **NDJSON** | Newline-delimited JSON for streaming | `all.ndjson` |
126+ | **CSV** | Multiple CSV files | `csv/` directory |
127+
128+ ### Endpoints
129+
130+ - `/api/v1/brands/{slug}/index.json` - Individual brand with filaments
131+ - `/api/v1/stores/index.json` - List of stores
132+ - `/api/v1/stores/{slug}.json` - Individual store
133+ - `/api/v1/schemas/index.json` - List of available JSON schemas
134+ - `/api/v1/schemas/{name}.json` - Individual JSON schema
135+
136+ ### Direct Downloads
137+
138+ - `/json/all.json` - Complete dataset
139+ - `/sqlite/filaments.db` - SQLite database
140+ - `/csv/` - CSV files
141+
142+ ### Checksums
143+
144+ See `manifest.json` for SHA256 checksums of all files.
228145 files : |
229146 dist/json/all.json
230147 dist/json/all.json.gz
231148 dist/json/all.ndjson
232149 dist/sqlite/filaments.db
233150 dist/sqlite/filaments.db.xz
234- dist/sqlite/stores.db
235- dist/sqlite/stores.db.xz
236151 dist/manifest.json
237152 draft : false
238153 prerelease : false
239- generate_release_notes : false
154+ generate_release_notes : true
240155
241156 # Validate the build
242157 validate :
@@ -258,16 +173,12 @@ jobs:
258173
259174 - name : Validate SQLite
260175 run : |
261- echo "Validating SQLite databases..."
262- echo "Filaments database:"
176+ echo "Validating SQLite database..."
263177 sqlite3 dist/sqlite/filaments.db "SELECT COUNT(*) FROM brand;"
264178 sqlite3 dist/sqlite/filaments.db "SELECT COUNT(*) FROM filament;"
265179 sqlite3 dist/sqlite/filaments.db "SELECT COUNT(*) FROM variant;"
266180 sqlite3 dist/sqlite/filaments.db "SELECT COUNT(*) FROM size;"
267- echo ""
268- echo "Stores database:"
269- sqlite3 dist/sqlite/stores.db "SELECT COUNT(*) FROM store;"
270- echo "✓ SQLite databases are valid"
181+ echo "✓ SQLite database is valid"
271182
272183 - name : Test SQLite queries
273184 run : |
0 commit comments