Skip to content

Commit 170910b

Browse files
author
Xing Han Lu
authored
Merge pull request #560 from plotly/github-actions-auto-release
Add automation to automatically release zipped apps Former-commit-id: ce31166
2 parents 1b87ebc + ca5a23b commit 170910b

File tree

2 files changed

+60
-1
lines changed

2 files changed

+60
-1
lines changed

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# https://github.com/actions/upload-release-asset/issues/28#issuecomment-617208601
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
name: Release and upload apps
8+
9+
jobs:
10+
build:
11+
name: Upload Release Asset
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
with:
17+
fetch-depth: '0'
18+
- name: Bump version and push tag
19+
id: version_bump
20+
uses: anothrNick/[email protected]
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
WITH_V: true
24+
- name: Compress apps
25+
run: |
26+
cd ./apps;
27+
for f in */; do
28+
echo "Zipping ${f}...";
29+
zip -qr "${f%/*}" "${f}"*;
30+
done
31+
cd -;
32+
- name: Create release and upload zipped apps
33+
run: |
34+
cd ./apps;
35+
set -x
36+
assets=()
37+
for asset in ./*.zip; do
38+
assets+=("-a" "$asset")
39+
done
40+
hub release create "${assets[@]}" -m "Release ${RELEASE_TAG}" "${RELEASE_TAG}"
41+
cd -;
42+
env:
43+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+
RELEASE_TAG: ${{ steps.version_bump.outputs.new_tag }}

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is a monorepo designed to host all of the apps that have been
44
created for the Python Dash Gallery.
55

6-
## Running an example app
6+
## Running an example app after cloning the repo
77

88
You will need to run applications, and specify filenames, from the
99
root directory of the repository. e.g., if the name of the app you
@@ -14,6 +14,21 @@ of the repository.
1414
Each app has a requirements.txt, install the dependecies in a virtual
1515
environment.
1616

17+
## Downloading and running a single app
18+
19+
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:
20+
21+
```bash
22+
python -m venv venv
23+
source venv/bin/activate # Windows: \venv\scripts\activate
24+
pip install -r requirements.txt
25+
```
26+
27+
then run the app:
28+
```bash
29+
python app.py
30+
```
31+
1732
## Contributing to the sample apps repo
1833

1934
_"DDS app" below refers to the deployed application. For example, if

0 commit comments

Comments
 (0)