Skip to content

Commit

Permalink
fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
mhuebert committed Jan 16, 2025
1 parent 91607bd commit f34525a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,28 +96,22 @@ jobs:
# Convert to npm version format if it's a dev version
if [[ $VERSION == *.dev ]]; then
# Extract date and time parts, removing .dev suffix
DATE_TIME=$(echo $VERSION | sed 's/\.dev$//')
# Format as 0.0.0-dev.YYYYMMDDHHMMSS
NPM_VERSION="0.0.0-dev.$(echo $DATE_TIME | sed 's/\.//g')"
else
NPM_VERSION=$VERSION
fi
JSDELIVR_URL="https://cdn.jsdelivr.net/npm/@probcomp/genstudio@${NPM_VERSION}/dist/widget_build.js"
# Create a temporary build directory
mkdir -p build/genstudio
cp -r src/genstudio/* build/genstudio/
# Update the widget URL in the build copy
sed -i "s|_esm = WIDGET_URL|_esm = \"${JSDELIVR_URL}\"|" build/genstudio/widget.py
# Update the widget URL in the source
sed -i "s|_esm = WIDGET_URL|_esm = \"${JSDELIVR_URL}\"|" src/genstudio/widget.py
# Build from the modified source
poetry build --source-directory build
# Build with modified source
poetry build
# Clean up
rm -rf build
# Restore the file using git
git checkout src/genstudio/widget.py
- name: Deploy to Artifact Registry
run: |
Expand Down

0 comments on commit f34525a

Please sign in to comment.