Workflow file for this run
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, Test, and Release on new release branch" | |
on: | |
push: | |
branches: | |
- "release/*" | |
jobs: | |
run-playwright-tests: | |
uses: ./.github/workflows/playwright.yml | |
with: | |
ref: ${{ inputs.ref }} | |
release: | |
needs: run-playwright-tests | |
environment: release | |
steps: | |
- name: Checkout Streamlit code | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ inputs.ref }} | |
persist-credentials: false | |
submodules: "recursive" | |
fetch-depth: 2 | |
- name: Set up Python 3.12 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- name: Setup Node | |
uses: actions/setup-node@v4 | |
with: | |
node-version-file: ".nvmrc" | |
cache: "npm" | |
cache-dependency-path: "**/package-lock.json" | |
- name: Make frontend | |
run: | | |
cd streamlit_bokeh/frontend | |
npm install | |
npm run build | |
# Combine hashes of the Python interpreter, Pipfile, and today's | |
# date into a file whose hash will key the Python virtualenv. | |
# | |
# This means that our virtualenv cache will expire each day. We do | |
# this because we are not using a lockfile to pin dependencies - | |
# instead, each time Github Actions rebuilds the virtualenv, it uses the | |
# latest compatible version of each dependency (which mirrors what | |
# happens when a user installs Streamlit locally). So we expire our | |
# virtualenv cache daily to prevent it from getting far out of sync | |
# with what a fresh Streamlit installation would look like. | |
- name: Create Python environment cache key | |
run: | | |
md5sum $(which python) > $GITHUB_WORKSPACE/python_cache_key.md5 | |
md5sum e2e_playwright/test-requirements.txt >> $GITHUB_WORKSPACE/python_cache_key.md5 | |
md5sum setup.py >> $GITHUB_WORKSPACE/python_cache_key.md5 | |
date +%F >> $GITHUB_WORKSPACE/python_cache_key.md5 | |
shell: bash | |
- name: Restore virtualenv from cache | |
id: cache-virtualenv | |
uses: actions/cache@v4 | |
with: | |
path: venv | |
key: v1-python-venv-${{ hashFiles('**/python_cache_key.md5') }} | |
- name: Build the package | |
run: | | |
python -m venv venv | |
source venv/bin/activate | |
pip install setuptools | |
python setup.py sdist bdist_wheel | |
- name: Store Package | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Release | |
path: dist | |
- name: Upload to PyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
packages-dir: dist/ | |
- name: Merge to Main | |
if: ${{ success() }} | |
steps: | | |
git checkout main | |
git merge ${{ inputs.ref }} | |
git push origin main |