Skip to content

Commit 69e846b

Browse files
authored
Merge pull request #100 from microsoftgraph/task/automate-package-publishing
Add workflows to automate package publishing
2 parents 34f4992 + 43e3c53 commit 69e846b

File tree

5 files changed

+64
-13
lines changed

5 files changed

+64
-13
lines changed

.github/RELEASE-TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Notes
2+
* First Note
3+
4+
# Changes

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
33

4-
name: msgraph-sdk-python-core
4+
name: CI
55

66
on:
77
pull_request:

.github/workflows/publish.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Publish MsGraph-Core package to PyPI
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
publish:
10+
name: Create release and publish distribution to PyPI
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Set up Python 3.8
16+
uses: actions/setup-python@v1
17+
with:
18+
python-version: 3.8
19+
- name: Install flit
20+
run: |
21+
pip install flit
22+
- name: Publish the distibution to PyPI
23+
if: github.repository == 'microsoftgraph/msgraph-sdk-python-core'
24+
run: flit publish
25+
env:
26+
FLIT_INDEX_URL: https://upload.pypi.org/legacy/
27+
FLIT_USERNAME: __token__
28+
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Create a release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10
7+
8+
jobs:
9+
autorelease:
10+
name: Create release
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Set up Python 3.8
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: 3.8
21+
- name: Release Notes
22+
run: |
23+
git log $(git describe HEAD~ --tags --abbrev=0)..HEAD --pretty='format:* %h %s%n' --no-merges >> ".github/RELEASE-TEMPLATE.md"
24+
- name: Create Release Draft
25+
uses: softprops/action-gh-release@v1
26+
if: github.repository == 'microsoftgraph/msgraph-sdk-python-core' && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
27+
with:
28+
body_path: ".github/RELEASE-TEMPLATE.md"
29+
draft: true
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.pypirc

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

0 commit comments

Comments
 (0)