Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automation to automatically release zipped apps #560

Merged
merged 3 commits into from
Feb 12, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -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 }}
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 `<name>` by the name of the app:

```bash
wget https://github.com/plotly/dash-sample-apps/releases/latest/download/<name>.zip
xhluca marked this conversation as resolved.
Show resolved Hide resolved
unzip <name>.zip
cd <name>/
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
Expand Down