-
-
Notifications
You must be signed in to change notification settings - Fork 4
56 lines (54 loc) · 1.85 KB
/
pythonpublish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Install dependencies
run: |
make init
- name: Set up Node.js 14
uses: actions/setup-node@v4
with:
node-version: "14.x"
- name: Install Dependencies
run: npm install --legacy-peer-deps
- name: Compile frontend assets
run: |
npm run production
# here we run tests after having compiled the assets, because tests can use it
- name: Publish only packages passing test
run: |
make test
# we need to use --allow-empty when compiled assets don't change from one version to the next
- name: Bump version with compiled assets
shell: bash
env:
RELEASE_VERSION: ${{ github.event.release.tag_name }}
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -f src/exceptionite/templates/exceptionite.js
git add -f src/exceptionite/templates/exceptionite.css
git commit -m"Release $RELEASE_VERSION" --allow-empty
- name: Push compiled assets
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.event.release.target_commitish }}
# override the tag created by GitHub release, now this tag will contains the compiled assets
tags: true
force: true
- name: Publish package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
make publish