Host Test App #38
This file contains 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: Host Test App | |
on: | |
workflow_dispatch: | |
inputs: | |
pr_number: | |
description: 'Pull Request Number' | |
required: true | |
type: string | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: refs/pull/${{ github.event.inputs.pr_number }}/merge | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: 3.12 | |
- name: 'Setup Chrome and chromedriver' | |
uses: nanasess/setup-chromedriver@v2 | |
- name: 'Setup chromedriver environment' | |
run: | | |
export DISPLAY=:99 | |
chromedriver --url-base=/wd/hub & | |
- name: Start XVFB | |
run: Xvfb :99 & | |
- name: Setup uv | |
run: | | |
curl -LsSf https://astral.sh/uv/install.sh | sh | |
uv venv | |
- name: Install package and Build | |
run: | | |
source .venv/bin/activate | |
uv pip install --upgrade pip | |
uv pip install wheel | |
uv pip install ".[dev]" | |
uv pip install PyGithub | |
npm ci | |
npm i | |
npm run build | |
npm run dist | |
timeout-minutes: 20 | |
- name: Extract Version | |
id: extract_version | |
run: | | |
version=$(jq -r '.version' package.json) | |
echo "version=$version" >> $GITHUB_ENV | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: dist-artifact | |
path: dist/dash_mantine_components-${{ env.version }}-py3-none-any.whl # Use the extracted version | |
- name: Get Artifact ID | |
id: get_artifact_id | |
run: | | |
artifact_id=$(curl -s \ | |
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ | |
-H "Accept: application/vnd.github.v3+json" \ | |
https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts \ | |
| jq -r '.artifacts[0].id') | |
echo "artifact_id=$artifact_id" >> $GITHUB_ENV | |
- name: Get download URL | |
run: echo "artifact_url=https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/${{ env.artifact_id }}" >> $GITHUB_ENV | |
- name: Post Link | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_REPOSITORY: ${{ github.repository }} | |
PR_NUMBER: ${{ github.event.inputs.pr_number }} | |
ARTIFACT_URL: ${{ env.artifact_url }} | |
ARTIFACT_ID: ${{ env.artifact_id }} | |
GITHUB_OWNER: snehilvj | |
FILE_FULLNAME: dash_mantine_components-${{ env.version }}-py3-none-any.whl | |
PACKAGE_NAME: dash_mantine_components | |
run: | | |
source .venv/bin/activate | |
python tmp_deploy.py |