Skip to content

Commit 8442ac4

Browse files
authored
Merge pull request #308 from microsoftgraph/chore/workflow-improvements
Chore/workflow improvements
2 parents 9c38c2c + fcb4eac commit 8442ac4

File tree

5 files changed

+122
-52
lines changed

5 files changed

+122
-52
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**Title**
2+
3+
**Environment**
4+
5+
- Python Version:
6+
- msgraph-beta-sdk version:
7+
- OS:
8+
9+
**Stack trace (if available)**
10+
Screenshot or `formatted` copy and paste of your stack trace.
11+
12+
**Describe the bug**
13+
A clear and concise description of what the bug is.
14+
15+
**To Reproduce**
16+
Steps to reproduce the behavior:
17+
18+
**Expected behavior**
19+
A clear and concise description of what you expected to happen.
20+
21+
**Screenshots**
22+
If applicable, add screenshots to help explain your problem.
23+
24+
**Additional context**
25+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest a feature for this project
4+
title: ''
5+
labels: enhancement
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

.github/workflows/build.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and valiate SDK package
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ main ]
7+
pull_request:
8+
branches: [ main, dev ]
9+
10+
permissions:
11+
contents: read
12+
13+
jobs:
14+
validate:
15+
name: Validate code accuracy
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- name: Set up Python
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: '3.8'
23+
- name: Install dependencies
24+
run: |
25+
python -m pip install --upgrade pip
26+
pip install -r requirements-dev.txt
27+
- name: Lint with Pylint
28+
run: pylint msgraph_beta --disable=W --rcfile=.pylintrc

.github/workflows/build_publish.yml

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

.github/workflows/publish.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Publish package to PyPI and create release
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+
9+
jobs:
10+
build:
11+
uses: ./.github/workflows/build.yml
12+
13+
publish:
14+
name: Publish distribution to PyPI
15+
runs-on: ubuntu-latest
16+
if: startsWith(github.ref, 'refs/tags/v')
17+
environment: pypi_prod
18+
needs: [build]
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v5
24+
with:
25+
python-version: 3.12
26+
- name: Install flit
27+
run: |
28+
pip install flit
29+
- name: Publish the distibution to PyPI
30+
run: flit publish
31+
env:
32+
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
33+
FLIT_USERNAME: __token__
34+
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}
35+
36+
release:
37+
name: Create release
38+
runs-on: ubuntu-latest
39+
needs: [publish]
40+
steps:
41+
- name: Checkout
42+
uses: actions/checkout@v4
43+
- name: Extract release notes
44+
id: extract-release-notes
45+
uses: ffurrer2/extract-release-notes@v1
46+
- name: Create release
47+
env:
48+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49+
run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }}

0 commit comments

Comments
 (0)