-
Notifications
You must be signed in to change notification settings - Fork 2
125 lines (109 loc) · 3.7 KB
/
release.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
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
name: release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.9', '3.10', '3.11']
steps:
- uses: compas-dev/compas-actions.build@v3
with:
python: ${{ matrix.python }}
invoke_lint: true
invoke_test: false
- name: Run unit tests
run: |
pytest tests/unit
integration_tests:
if: "!contains(github.event.pull_request.labels.*.name, 'docs-only')"
runs-on: 'ubuntu-latest'
steps:
- name: Set up docker container
run: |
docker run -d --name nanomq -p 1883:1883 -p 8083:8083 -p 8883:8883 emqx/nanomq:latest
docker ps -a
- uses: compas-dev/compas-actions.build@v3
with:
python: '3.11'
invoke_lint: false
invoke_test: false
- name: Run integration tests
run: |
pytest tests/integration
- name: Tear down docker container
run: |
docker rm -f nanomq
Publish:
needs: build
runs-on: windows-latest
steps:
# The steps should rely on compas-actions.publish
# but this bug is blocking it: https://github.com/compas-dev/compas-actions.publish/issues/1
# so atm, it's a copy of the steps
# - uses: compas-dev/compas-actions.publish@v2
# with:
# pypi_token: ${{ secrets.PYPI }}
# github_token: ${{ secrets.TOKEN }}
# build_ghpython_components: true
# gh_source: src/compas_eve/ghpython/components
# gh_target: src/compas_eve/ghpython/components/ghuser
# release_name_prefix: COMPAS EVE v
- uses: actions/checkout@v3
- name: Get Version From Tag
id: tag_name
run: |
echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash
- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md
- name: Assemble Release Name
id: assemble_release_name
shell: bash
run: |
release_name="COMPAS EVE v${{ steps.tag_name.outputs.current_version }}"
echo Using release name: $release_name
echo "release_name=$release_name" >> $GITHUB_OUTPUT
- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
with:
body: ${{ steps.changelog_reader.outputs.changes }}
token: ${{ secrets.TOKEN }}
name: ${{ steps.assemble_release_name.outputs.release_name }}
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install CPython dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install --no-cache-dir -r requirements-dev.txt
- uses: NuGet/[email protected]
- name: Install dependencies
run: |
choco install ironpython --version=2.7.8.1
- uses: compas-dev/compas-actions.ghpython_components@v4
with:
source: src/compas_eve/ghpython/components
target: src/compas_eve/ghpython/components/ghuser
prefix: ""
- shell: bash
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py clean --all sdist bdist_wheel
twine check dist/*
twine upload dist/* --skip-existing
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}