-
-
Notifications
You must be signed in to change notification settings - Fork 8
74 lines (72 loc) · 2.02 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
name: Release
on:
release:
types: [published]
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: 🏗 Set up Node 14
uses: actions/setup-node@v2
with:
node-version: '14'
- name: 🏗 Install build dependencies
run: |
python -m pip install wheel octoprint --user
npm install -g npm@7
npm install
- name: 🔨 Build frontend code in release mode
run: |
npm run release
- name: 🔨 Commit changes to make versioneer happy
uses: EndBug/add-and-commit@v7
with:
push: false
branch: main
- name: 🔨 Build a source zip
run: |
python setup.py sdist --formats=zip
- name: 🚚 rename to sdist.zip
run: |
mv dist/OctoPrint-WLED-*.zip dist/sdist.zip
- name: ⬆ Upload build result
uses: actions/upload-artifact@v1
with:
name: dist
path: dist
upload-asset:
name: 📦 Upload asset to release
runs-on: ubuntu-latest
needs:
- build
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