Skip to content

Commit 9ad99b4

Browse files
committed
build: update CI scripts
This: 1. Extracts the code linter to a separate workflow. 2. Adds commit linter. 3. Adds PyPI publishing workflow. 4. Adds scheduled Python requirements updates.
1 parent 0d2cd10 commit 9ad99b4

File tree

5 files changed

+82
-8
lines changed

5 files changed

+82
-8
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,3 @@ jobs:
4444
with:
4545
flags: unittests
4646
fail_ci_if_error: true
47-
48-
lint:
49-
runs-on: ubuntu-latest
50-
steps:
51-
- uses: actions/checkout@v3
52-
- uses: psf/black@stable
53-
with:
54-
options: --check --diff

.github/workflows/commitlint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: Lint Commit Messages
2+
3+
on:
4+
- pull_request
5+
6+
jobs:
7+
commitlint:
8+
uses: openedx/.github/.github/workflows/commitlint.yml@master

.github/workflows/lint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches:
8+
- '**'
9+
10+
jobs:
11+
lint:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
- uses: psf/black@stable
16+
with:
17+
options: --check --diff

.github/workflows/pypi-publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish package to PyPi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
push:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
- name: setup python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: 3.11
19+
20+
- name: Install pip
21+
run: pip install -r requirements/pip.txt
22+
23+
- name: Build package
24+
run: python setup.py sdist bdist_wheel
25+
26+
- name: Publish to PyPi
27+
uses: pypa/gh-action-pypi-publish@release/v1
28+
with:
29+
user: __token__
30+
password: ${{ secrets.PYPI_UPLOAD_TOKEN }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Upgrade Python Requirements
2+
3+
on:
4+
schedule:
5+
- cron: 0 2 * * 1
6+
workflow_dispatch:
7+
inputs:
8+
branch:
9+
description: Target branch against which to create requirements PR
10+
required: true
11+
default: main
12+
13+
jobs:
14+
call-upgrade-python-requirements-workflow:
15+
uses: openedx/.github/.github/workflows/upgrade-python-requirements.yml@master
16+
with:
17+
branch: ${{ github.event.inputs.branch || 'main' }}
18+
# optional parameters below; fill in if you'd like github or email notifications
19+
# user_reviewers: ""
20+
# team_reviewers: ""
21+
# email_address: ""
22+
send_success_notification: false
23+
secrets:
24+
requirements_bot_github_token: ${{ secrets.REQUIREMENTS_BOT_GITHUB_TOKEN }}
25+
requirements_bot_github_email: ${{ secrets.REQUIREMENTS_BOT_GITHUB_EMAIL }}
26+
edx_smtp_username: ${{ secrets.EDX_SMTP_USERNAME }}
27+
edx_smtp_password: ${{ secrets.EDX_SMTP_PASSWORD }}

0 commit comments

Comments
 (0)