From 973f6fc48f80bec3c2acd1c9efb04529cff78223 Mon Sep 17 00:00:00 2001 From: xhlulu Date: Thu, 11 Feb 2021 13:45:51 -0500 Subject: [PATCH 1/3] Automation for uploading zipped apps and release - Automatically bump version - Upload zipped apps - Release app --- .github/workflows/main.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..727023229 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +# https://github.com/actions/upload-release-asset/issues/28#issuecomment-617208601 +on: + push: + branches: + - master + +name: Release and upload apps + +jobs: + build: + name: Upload Release Asset + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + fetch-depth: '0' + - name: Bump version and push tag + id: version_bump + uses: anothrNick/github-tag-action@1.34.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + WITH_V: true + - name: Compress apps + run: | + cd ./apps; + for f in */; do + echo "Zipping ${f}..."; + zip -qr "${f%/*}" "${f}"*; + done + cd -; + - name: Create release and upload zipped apps + run: | + cd ./apps; + set -x + assets=() + for asset in ./*.zip; do + assets+=("-a" "$asset") + done + hub release create "${assets[@]}" -m "Release ${RELEASE_TAG}" "${RELEASE_TAG}" + cd -; + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_TAG: ${{ steps.version_bump.outputs.new_tag }} \ No newline at end of file From 11de03669a2e0d5a4e0d5e36659d3f3594f8d54d Mon Sep 17 00:00:00 2001 From: xhlulu Date: Thu, 11 Feb 2021 13:52:54 -0500 Subject: [PATCH 2/3] Add instructions on downloading/running single app --- README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 424988bdf..4a1ec7a40 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ This is a monorepo designed to host all of the apps that have been created for the Python Dash Gallery. -## Running an example app +## Running an example app after cloning the repo You will need to run applications, and specify filenames, from the root directory of the repository. e.g., if the name of the app you @@ -14,6 +14,20 @@ of the repository. Each app has a requirements.txt, install the dependecies in a virtual environment. +## Downloading and running a single app + +If you don't want to clone the entire repo, you can also download an individual app as a zip file (see the [releases](https://github.com/plotly/dash-sample-apps/releases)), decompress and run them. In the example below, replace `` by the name of the app: + +```bash +wget https://github.com/plotly/dash-sample-apps/releases/latest/download/.zip +unzip .zip +cd / +python -m venv venv +source venv/bin/activate # Windows: \venv\scripts\activate +pip install -r requirements.txt +python app.py +``` + ## Contributing to the sample apps repo _"DDS app" below refers to the deployed application. For example, if From bcf3f6450630875f218b41c4959dbcd91099ff57 Mon Sep 17 00:00:00 2001 From: Xing Han Lu Date: Fri, 12 Feb 2021 13:25:33 -0500 Subject: [PATCH 3/3] Update README.md --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4a1ec7a40..9bb12444a 100644 --- a/README.md +++ b/README.md @@ -16,15 +16,16 @@ environment. ## Downloading and running a single app -If you don't want to clone the entire repo, you can also download an individual app as a zip file (see the [releases](https://github.com/plotly/dash-sample-apps/releases)), decompress and run them. In the example below, replace `` by the name of the app: +Visit the [releases page](https://github.com/plotly/dash-sample-apps/releases) and download and `unzip` the app you want. Then `cd` into the app directory and install its dependencies in a virtual environment in the following way: ```bash -wget https://github.com/plotly/dash-sample-apps/releases/latest/download/.zip -unzip .zip -cd / python -m venv venv source venv/bin/activate # Windows: \venv\scripts\activate pip install -r requirements.txt +``` + +then run the app: +```bash python app.py ```