-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (106 loc) · 2.77 KB
/
main.yaml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: Main
on:
push:
branches:
- master
- develop
tags:
- '**'
pull_request:
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: write
pages: write
id-token: write
checks: write
pull-requests: write
jobs:
test:
uses: ./.github/workflows/test.yaml
lint:
uses: ./.github/workflows/lint.yaml
release:
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/plotly-gtk # Replace <package-name> with your PyPI project name
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Build
run: pip install build && python -m build
- name: Release
uses: softprops/action-gh-release@v1
with:
files: dist/*
- name: Publish to PyPI
if: always()
uses: pypa/gh-action-pypi-publish@release/v1
# Build job
build-docs:
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install apt packages
run: |
sudo apt update
sudo apt install libgirepository1.0-dev libcairo2-dev pkg-config python3-dev gir1.2-gtk-4.0 gir1.2-adw-1 gir1.2-webkit-6.0 make graphviz
- name: Install python packages
run: |
pip install wheel
pip install -e .[doc]
- name: Get demo artifact
uses: actions/download-artifact@v4
with:
name: demo
path: sphinx/source/examples
- name: Get report artifact
uses: actions/download-artifact@v4
with:
name: report
path: sphinx/source/prebuilt
- name: Build pages
run: |
cd sphinx
make html
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: sphinx/build/html
deploy-docs:
concurrency:
group: "pages"
cancel-in-progress: false
if: github.ref_name == 'master'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build-docs
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2