Skip to content

Commit 17312b3

Browse files
committed
Switch to Github Actions
1 parent 6c40987 commit 17312b3

File tree

4 files changed

+110
-123
lines changed

4 files changed

+110
-123
lines changed

.circleci/config.yml

Lines changed: 0 additions & 121 deletions
This file was deleted.

.github/workflows/ci-cd.yml

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
name: CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
pull_request:
9+
branches: [ main ]
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Set up Python
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.12'
20+
- name: Install dependencies
21+
run: |
22+
pip install poetry
23+
poetry install
24+
- name: Run tests
25+
run: poetry run pytest
26+
- name: Upload test results
27+
uses: actions/upload-artifact@v3
28+
with:
29+
name: test-results
30+
path: test-results
31+
32+
build-docs:
33+
needs: build-and-test
34+
runs-on: ubuntu-latest
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Set up Python
38+
uses: actions/setup-python@v4
39+
with:
40+
python-version: '3.12'
41+
- name: Install dependencies
42+
run: |
43+
pip install poetry
44+
poetry install
45+
poetry add mkdocs mkdocs-material mkdocstrings[python]
46+
- name: Build documentation
47+
run: poetry run mkdocs build
48+
- name: Upload documentation
49+
uses: actions/upload-artifact@v3
50+
with:
51+
name: site
52+
path: site
53+
54+
deploy-docs:
55+
needs: build-docs
56+
runs-on: ubuntu-latest
57+
if: startsWith(github.ref, 'refs/tags/')
58+
steps:
59+
- uses: actions/checkout@v3
60+
- name: Download built site
61+
uses: actions/download-artifact@v3
62+
with:
63+
name: site
64+
path: site
65+
- name: Deploy to GitHub Pages
66+
uses: peaceiris/actions-gh-pages@v3
67+
with:
68+
github_token: ${{ secrets.GITHUB_TOKEN }}
69+
publish_dir: ./site
70+
71+
create-release:
72+
needs: [build-and-test, deploy-docs]
73+
runs-on: ubuntu-latest
74+
if: startsWith(github.ref, 'refs/tags/')
75+
steps:
76+
- uses: actions/checkout@v3
77+
- name: Create Release
78+
id: create_release
79+
uses: actions/create-release@v1
80+
env:
81+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82+
with:
83+
tag_name: ${{ github.ref }}
84+
release_name: Release ${{ github.ref }}
85+
draft: false
86+
prerelease: false
87+
88+
release:
89+
needs: create-release
90+
runs-on: ubuntu-latest
91+
steps:
92+
- uses: actions/checkout@v3
93+
- name: Set up Python
94+
uses: actions/setup-python@v4
95+
with:
96+
python-version: '3.12'
97+
- name: Install dependencies
98+
run: |
99+
pip install poetry
100+
poetry install
101+
- name: Build package
102+
run: poetry build
103+
- name: Publish to PyPI
104+
env:
105+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
106+
run: |
107+
poetry config pypi-token.pypi $PYPI_TOKEN
108+
poetry publish

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<div align="center">
44

5-
[![CircleCI](https://dl.circleci.com/status-badge/img/circleci/HnjwXsMN4bebM2B2r69BKp/A9i1RqBjrUCp2Prq5brJgh/tree/main.svg?style=shield&circle-token=CCIPRJ_3zJ7eJJi16hxx8JGuNxZtP_907df1eecb62b96f7dbc93bdd9c239d0cd4674c6)](https://dl.circleci.com/status-badge/redirect/circleci/HnjwXsMN4bebM2B2r69BKp/A9i1RqBjrUCp2Prq5brJgh/tree/main)
5+
[![CI/CD](https://github.com/hyperb1iss/signalrgb-python/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/hyperb1iss/signalrgb-python/actions)
66
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
77
[![PyPI version](https://badge.fury.io/py/signalrgb.svg)](https://badge.fury.io/py/signalrgb)
88

scripts/release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ git commit -m ":bookmark: Release: $new_version"
2727
git tag -a v$new_version -m "Release: $new_version"
2828
git push origin main --tags
2929

30-
echo "Release $new_version has been created and pushed. CircleCI will handle the rest, including documentation deployment."
30+
echo "Release $new_version has been created and pushed. CI will handle the rest, including documentation deployment."

0 commit comments

Comments
 (0)