Skip to content

Commit

Permalink
Merge pull request #8 from reallistic/npm_build_before_publish
Browse files Browse the repository at this point in the history
test out compiling UI assets before publishing
  • Loading branch information
reallistic authored Jun 11, 2020
2 parents 11a0570 + 676ded5 commit d6f7fc6
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 20 deletions.
46 changes: 27 additions & 19 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,32 @@ on:
types: [created]

jobs:
deploy:

build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- uses: actions/checkout@v2
- name: Set up npm
uses: actions/setup-node@v1
with:
node-version: 12
- name: npm install
run: npm i
- name: npm build
env:
NODE_ENV: production
run: npm run build
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.6"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
8 changes: 8 additions & 0 deletions pyloot/static/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# This file only exists to keep this dir around for static asset building
###################

# Ignore all files in this dir...
*

# ... except for this one.
!.gitignore
4 changes: 3 additions & 1 deletion webpack.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ module.exports = {
publicPath: "static",
},
plugins: [
new CleanWebpackPlugin(),
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["**/*", "!.gitignore"]
}),
new HtmlWebpackPlugin({
template: "./pyloot-web/index.html",
}),
Expand Down

0 comments on commit d6f7fc6

Please sign in to comment.