-
Notifications
You must be signed in to change notification settings - Fork 25
146 lines (141 loc) · 4.26 KB
/
release.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Release
on:
release:
types: [ published ]
jobs:
build:
name: Build the distribution
runs-on: ubuntu-latest
env:
NODE_VERSION: 18.x
PYTHON_VERSION: 3.11
OCTOPRINT_VERSION: 1.9
steps:
### UI
- name: Get yarn cache dir
id: yarnCache
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Cache node modules
uses: actions/cache@v4
with:
path: ${{ steps.yarnCache.outputs.dir }}
key: ${{ runner.os }}-release-cache-yarn-${{ hashFiles('**/yarn.lock') }}
- name: Install UI dependencies
working-directory: ui
run: yarn install
- name: Build JS
working-directory: ui
run: yarn build
### Python
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Get pip cache dir
id: pipCache
run: echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT
- name: Cache pip modules
uses: actions/cache@v4
with:
path: ${{ steps.pipCache.outputs.dir }}
key: ${{ runner.os }}-release-cache-pip
- name: Install distribution dependencies
run: pip install --upgrade wheel setuptools pip
- name: Install OctoPrint
run: pip install octoprint~=${{ env.OCTOPRINT_VERSION }}.0
### Packing
- name: Build distribution package
run: python setup.py sdist --formats=zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
integration:
name: Integration test on Python ${{ matrix.python }}, OctoPrint ${{ matrix.octoprint }}
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
python: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12" ]
octoprint: [ "1.5", "1.6", "1.7", "1.8", "1.9", "1.10" ]
exclude:
# These versions are not compatible to each other:
- octoprint: 1.5
python: 3.10
- octoprint: 1.5
python: 3.11
- octoprint: 1.5
python: 3.12
- octoprint: 1.6
python: 3.10
- octoprint: 1.6
python: 3.11
- octoprint: 1.6
python: 3.12
- octoprint: 1.7
python: 3.10
- octoprint: 1.7
python: 3.11
- octoprint: 1.7
python: 3.12
- octoprint: 1.8
python: 3.10
- octoprint: 1.8
python: 3.11
- octoprint: 1.8
python: 3.12
- octoprint: 1.9
python: 3.12
steps:
- name: Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Install OctoPrint
run: pip install octoprint~=${{ matrix.octoprint }}.0
- name: Install Wheel
# see https://community.octoprint.org/t/setuptools-error-while-installing-plugin-octoklipper-on-manual-op-installation/51387
run: pip install wheel
- name: Install the distributed package
run: pip install dist/octorelay-*.zip
attach:
name: Attaching asset to the release
runs-on: ubuntu-latest
needs:
- build
- integration
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Rename to release.zip
run: cp dist/octorelay-*.zip release.zip
- name: Get release ID
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Attach the asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: release.zip
asset_name: release.zip
asset_content_type: application/zip