forked from K4CZP3R/tapo-p100-python
-
-
Notifications
You must be signed in to change notification settings - Fork 28
131 lines (118 loc) · 4.28 KB
/
build-publish.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
126
127
128
129
130
131
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
name: Release plugp100
on:
workflow_dispatch:
inputs:
skip_pypi_publish:
description: 'Skip PyPI publish'
default: 'false'
required: false
push:
branches:
- main
- next
- dev
# tags:
# - v*.*.*
jobs:
# build_vendoring_wheels:
# if: ${{ startsWith(github.ref, 'refs/tags/v') }}
# runs-on: ubuntu-latest
# name: Build on ${{ matrix.platform }} with ${{ matrix.python }}
#
# strategy:
# matrix:
# platform:
# - manylinux2014_aarch64
# - musllinux_1_1_aarch64
# - manylinux2014_armv7l
# python: [ python3.9, python3.10 ]
#
# steps:
# - name: Check out repository
# uses: actions/checkout@v3
# - name: Build wheels for ${{ matrix.python }} on ${{ matrix.platform }}
# uses: ./.github/actions/python-on-arch
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# arch: ${{ matrix.platform }}
# python: ${{ matrix.python }}
# run: |
# ${{ matrix.python }} --version
# echo "Generate vendoring wheel..."
# ${{ matrix.python }} build_tools/build_vendoring.py ./plugp100/_vendor ./.cache-pip
# echo "Generate library wheel with the right platform name"
# ${{ matrix.python }} build_tools/build_platform_wheel.py ./plugp100/_vendor requirements.txt
# ${{ matrix.python }} build_tools/rename_wheels.py ${{ matrix.platform }}
# - name: "Upload generated wheel for ${{ matrix.python }} ${{ matrix.platform }}"
# uses: actions/upload-artifact@v3
# with:
# name: wheel
# path: dist/*
publish_pypi:
name: Publish to PyPi
runs-on: ubuntu-latest
environment: release
# needs: [ build_vendoring_wheels ]
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{ secrets.GIT_GITHUB_TOKEN }}
persist-credentials: false
- name: Setup Node 20.x
uses: actions/setup-node@v4
with:
node-version: 20
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Semantic Release (Dry Run)
id: semantic
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true} ]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
dry_run: true
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN }}
- name: Bump version file
run: sed -i 's/__version__ = ".*"/__version__ = \"${{ steps.semantic.outputs.new_release_version }}\"/g' plugp100/__init__.py
- name: Generating Any and Source Distribution
run: |
python setup.py sdist bdist_wheel
ls -R
- name: Publish source distribution to PyPi
if: ${{ github.event.inputs.skip_pypi_publish != 'true' }}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload dist/*
- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
with:
semantic_version: 23.0.2
branches: |
[ 'main', {name: 'next', prerelease: true}, {name: 'dev', channel: 'dev', prerelease: true}]
extra_plugins: |
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
@semantic-release/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GIT_GITHUB_TOKEN }}