Skip to content

Commit a1fc57a

Browse files
Merge pull request #18 from IvanildoBarauna/feat-AutoRelease
feat AutoRelease
2 parents 16a59a5 + a94c79c commit a1fc57a

File tree

1 file changed

+17
-30
lines changed

1 file changed

+17
-30
lines changed

.github/workflows/CD.yaml

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
name: Build, Version, Release and Publish Package
22

33
on:
4+
pull_request:
5+
branches:
6+
- main
7+
48
workflow_dispatch:
9+
with:
10+
ref: ${{ github.head_ref }}
511

612
jobs:
713
build:
@@ -26,36 +32,17 @@ jobs:
2632
- name: Increment version
2733
run: |
2834
poetry version patch # params: patch, minor, major
35+
git config --global user.name 'GitHub Actions'
36+
git config --global user.email '[email protected]'
37+
git commit -am "chore: increment version"
38+
git push
2939
git tag $(poetry version -s)
3040
git push origin --tags
3141
32-
- name: Build package
33-
run: poetry build
34-
35-
- name: Publish package to PyPI
36-
env:
37-
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
38-
run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI
39-
40-
- name: Create GitHub Release
41-
id: create_release
42-
uses: actions/create-release@v1
43-
env:
44-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45-
with:
46-
tag_name: $(poetry version -s)
47-
release_name: Release $(poetry version -s)
48-
body: |
49-
Release $(poetry version -s) created.
50-
draft: false
51-
prerelease: false
52-
53-
- name: Upload Release Asset
54-
uses: actions/upload-release-asset@v1
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57-
with:
58-
upload_url: ${{ steps.create_release.outputs.upload_url }}
59-
asset_path: ./dist/your-package-name-$(poetry version -s).tar.gz
60-
asset_name: your-package-name-$(poetry version -s).tar.gz
61-
asset_content_type: application/gzip
42+
# - name: Build package
43+
# run: poetry build
44+
#
45+
# - name: Publish package to PyPI
46+
# env:
47+
# POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
48+
# run: poetry publish --username __token__ --password $POETRY_PYPI_TOKEN_PYPI

0 commit comments

Comments
 (0)