-
Notifications
You must be signed in to change notification settings - Fork 0
133 lines (120 loc) · 3.63 KB
/
Copy pathmain.yml
File metadata and controls
133 lines (120 loc) · 3.63 KB
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: docs_pages_workflow
permissions:
contents: write
pages: write
id-token: write
on:
push:
branches: [main]
jobs:
calculate-version:
name: Calculate Version
runs-on: ubuntu-latest
outputs:
semVer: ${{ steps.gitversion.outputs.semVer }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install GitVersion
uses: gittools/actions/gitversion/setup@v0.9.7
with:
versionSpec: '5.x'
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
with:
useConfigFile: true
display-semver:
name: Display Semantic Version
runs-on: ubuntu-latest
needs: calculate-version
env:
SEMVER: ${{ needs.calculate-version.outputs.semVer }}
steps:
- name: Display version
run: |
echo SemVer: $SEMVER
build-n-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI
runs-on: ubuntu-latest
needs: calculate-version
env:
SEMVER: ${{ needs.calculate-version.outputs.semVer }}
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
steps:
- uses: actions/checkout@master
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Install project requirements
run: >-
pip install -r requirements.txt
- name: Build binary wheel
run: |
python setup.py ${{env.SEMVER}} sdist bdist_wheel
- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: dist/
# build_docs_job:
# runs-on: ubuntu-latest
# needs: build-n-publish
# name: Build documentation and publishes it to GithubPages
# steps:
# - name: Checkout
# uses: actions/checkout@v4.0.0
# - name: Setup Python
# uses: actions/setup-python@v4.7.0
# with:
# python-version: 3.9
# - name: Install dependencies
# run: |
# python -m pip install -U sphinx
# python -m pip install sphinx-rtd-theme
# python -m pip install sphinxcontrib-bibtex
# python -m pip install ShockPy
# python -m pip install sphinx-gallery
# python -m pip install SciencePlots
# - name: Make the Sphinx Docs
# run: |
# make -C docs clean
# make -C docs html
# - name: Upload GitHub Pages artifact
# uses: actions/upload-pages-artifact@v2.0.0
# with:
# # Path of the directory containing the static assets.
# path: docs/build/html/
# - name: Deploy GitHub Pages site
# uses: actions/deploy-pages@v1.2.9
# with:
# token: ${{ github.token }}
release:
runs-on: ubuntu-latest
needs: [calculate-version, build-n-publish]
name: Create a Github Release
env:
GH_TOKEN: ${{ github.token }}
SEMVER: ${{ needs.calculate-version.outputs.semVer }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set the release tag environment variable
run: echo RELEASE_TAG=v$SEMVER >> $GITHUB_ENV
- name: Display Tag
run: echo $RELEASE_TAG
- name: Create Github release
run: |
gh release create $RELEASE_TAG