-
Notifications
You must be signed in to change notification settings - Fork 3
123 lines (111 loc) · 3.17 KB
/
release.yaml
File metadata and controls
123 lines (111 loc) · 3.17 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
name: Publish release
on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body: |
Changes in this Release:
draft: false
prerelease: false
docs:
needs: release
name: Publish Docs
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
with:
persist-credentials: false
- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2
- name: Print version
shell: bash
run: |
echo ${{ steps.get_version.outputs.version }}
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/requirements.yaml
cache-environment: true
cache-downloads: true
- name: Conda info
shell: bash -l {0}
run: conda info
- name: Install dependencies
shell: bash -l {0}
run: |
if [[ ! -d "$HOME/.local/bin" ]]; then
mkdir -p "$HOME/.local/bin";
fi
# copy modflow bins to local dir to add to PATH later
if [ "$RUNNER_OS" == "Windows" ]; then
d="win"
elif [ "$RUNNER_OS" == "macOS" ]; then
d="mac"
elif [ "$RUNNER_OS" == "Linux" ]; then
d="linux"
else
d="unexpectedos"
exit 1
fi
echo bin/$d/. >> $GITHUB_PATH
echo $GITHUB_PATH
pip install -e .
python -m ipykernel install --user --name mfexport_ci --display-name "mfexport_ci"
- name: Conda list
shell: bash -l {0}
run: micromamba list
- name: Run tests
shell: bash -l {0}
run: |
pytest mfexport/tests/test_notebooks.py
- name: Build docs
shell: bash -l {0}
run: |
set -e
make -C docs html
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@3.7.1
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: docs/build/html
CLEAN: false
TARGET_FOLDER: ${{ steps.get_version.outputs.version }}
deploy:
needs: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
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: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*