-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (43 loc) · 1.15 KB
/
auto-build.yml
File metadata and controls
51 lines (43 loc) · 1.15 KB
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
name: Build Python Package and Upload as Artifact
on:
push:
branches:
- main
paths:
- 'pyproject.toml'
- 'mcsmapi/**'
pull_request:
branches:
- main
jobs:
build-package:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: |
python -m build
- name: Check if it's a push event
if: github.event_name == 'push'
run: echo "Push event detected, proceeding to upload artifact..."
- name: Upload .tar.gz as artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: mcsmapi.tar.gz
path: dist/*.tar.gz
- name: Upload .whl as artifact
if: github.event_name == 'push'
uses: actions/upload-artifact@v4
with:
name: mcsmapi.whl
path: dist/*.whl