diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..84802a8 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -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. \ No newline at end of file diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..6a33282 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -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. \ No newline at end of file diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..f125a0d --- /dev/null +++ b/.github/pull_request_template.md @@ -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 \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6e3faae..ee4ac79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: branches: [main] pull_request: branches: [main, dev] + workflow_call: jobs: build: @@ -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 @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..e8643ee --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 }} \ No newline at end of file