-
-
Notifications
You must be signed in to change notification settings - Fork 27
85 lines (83 loc) · 2.37 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
name: Release
on:
release:
types: [published, prereleased]
jobs:
build:
name: 🔨 Build distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: 🏗 Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: 🏗 Install build dependencies
run: |
python -m pip install wheel octoprint --user
- name: 🔨 Build a source zip
run: |
python setup.py sdist --formats=zip
- name: 🚚 rename to sdist.zip
run: |
mv dist/OctoPrint-WS281x\ LED\ Status-*.zip dist/sdist.zip
- name: ⬆ Upload build result
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
test-install:
name: 🧪 Installation tests
needs: build
strategy:
matrix:
python: ["2.7", "3.7", "3.8"]
runs-on: ubuntu-latest
steps:
- name: 🏗 Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python }}
- name: ⬇ Download build result
uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: 🏗 Install dependencies
run: |
python -m pip install --upgrade wheel setuptools pip
python -m pip install octoprint
- name: 🧪 Test install of package
run: |
python -m pip install dist/sdist.zip
upload-asset:
name: 📦 Upload asset to release
runs-on: ubuntu-latest
needs:
- build
- test-install
steps:
- name: ⬇ Download build result
uses: actions/download-artifact@v1
with:
name: dist
path: dist
- name: 🚚 Rename to release.zip
run: |
cp dist/sdist.zip release.zip
- name: 🥅 Catch release ID
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
- name: 📦 Attach release artifact
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