Skip to content

Commit

Permalink
Merge pull request #199 from microsoft/chore/workflow-improvements
Browse files Browse the repository at this point in the history
Chore/workflow improvements
  • Loading branch information
samwelkanda authored Jan 11, 2024
2 parents e5903f9 + e3970e5 commit b0d8e11
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 24 deletions.
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
**Title**

**Environment**

- Python Version
- kiota-abstractions version:
- OS:

**Stack trace (if available)**
Screenshot or `formatted` copy and paste of your stack trace.

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest a feature for this project
title: ''
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
23 changes: 23 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Overview

Brief description of what this PR does, and why it is needed.

## Related Issue

Fixes # (issue)

### Demo

Optional. Screenshots, `curl` examples, etc.

### Notes

Optional. Ancillary topics, caveats, alternative strategies that didn't work out, anything else.

## Testing Instructions

* How to test this PR
* Prefer bulleted description
* Start after checking out this branch
* Include any setup required, such as bundling scripts, restarting services, etc.
* Include test case, and expected output
26 changes: 2 additions & 24 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
branches: [main]
pull_request:
branches: [main, dev]
workflow_call:

jobs:
build:
Expand All @@ -17,7 +18,7 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -44,26 +45,3 @@ jobs:
- name: Run the tests
run: |
pytest
publish:
name: Publish distribution to PyPI
if: ${{ github.ref == 'refs/heads/main' }}
runs-on: ubuntu-latest
environment: pypi_prod
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v5
with:
python-version: 3.8
- name: Install flit
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}
49 changes: 49 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Publish package to PyPI

on:
push:
branches: [main]
tags:
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
build:
uses: ./.github/workflows/build.yml

publish:
name: Publish distribution to PyPI
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
environment: pypi_prod
needs: [build]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.12
- name: Install flit
run: |
pip install flit
- name: Publish the distibution to PyPI
run: flit publish
env:
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
FLIT_USERNAME: __token__
FLIT_PASSWORD: ${{ secrets. PYPI_API_TOKEN }}

release:
name: Create release
runs-on: ubuntu-latest
needs: [publish]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Extract release notes
id: extract-release-notes
uses: ffurrer2/extract-release-notes@v1
- name: Create release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release create --notes '${{ steps.extract-release-notes.outputs.release_notes }}' --title ${{ github.ref_name }} ${{ github.ref_name }}

0 comments on commit b0d8e11

Please sign in to comment.