-
Notifications
You must be signed in to change notification settings - Fork 18
112 lines (92 loc) · 2.67 KB
/
dist.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
---
name: dist
on:
pull_request:
push:
# branches:
# - main
# tags:
# - '*'
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: psf/black@stable
build-whl:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
with:
python-version: 3.9
- uses: robotpy/build-actions/install-pure-build-deps@v2021
- uses: robotpy/build-actions/build-wheel@v2021
- uses: robotpy/build-actions/test-native-wheel@v2021
- uses: robotpy/build-actions/validate-sphinx@v2021
build-exe:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- shell: bash
run: |
./build_exe.sh
rm -f dist/windows/pynetworktables2js.exe
- uses: actions/upload-artifact@v2
with:
name: dist
path: dist
publish-pypi:
runs-on: ubuntu-18.04
needs: [check, build-whl, build-exe]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- run: pip install wheel
- name: Build packages
run: python setup.py sdist bdist_wheel
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.pypi_password }}
publish-github:
runs-on: ubuntu-18.04
needs: [check, build-whl, build-exe]
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
steps:
- uses: actions/[email protected]
with:
name: dist
path: dist/
- name: "Determine tag"
id: "determine-tag"
shell: bash
run: "echo \"::set-output name=tag::${GITHUB_REF#refs/tags/}\""
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
tag_name: ${{ steps.determine-tag.outputs.tag }}
release_name: Release ${{ steps.determine-tag.outputs.tag }}
draft: false
prerelease: false
- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_ACCESS_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/pynetworktables2js-${{ steps.determine-tag.outputs.tag }}.zip
asset_name: pynetworktables2js-${{ steps.determine-tag.outputs.tag }}.zip
asset_content_type: application/zip