Skip to content

Commit c96fd8d

Browse files
committed
ci: new bump and publish github actions
1 parent d69b138 commit c96fd8d

File tree

4 files changed

+76
-5
lines changed

4 files changed

+76
-5
lines changed

‎.github/workflows/bumpversion.yml

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Bump version
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
build:
10+
if: "!contains(github.event.head_commit.message, 'bump')"
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ['3.x']
15+
steps:
16+
- uses: actions/checkout@master
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v1
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python --version
24+
python --version
25+
python -m pip install -U commitizen
26+
- name: Create bump
27+
run: |
28+
git config --local user.email "action@github.com"
29+
git config --local user.name "GitHub Action"
30+
git config --local push.followTags true
31+
cz bump --yes
32+
git tag
33+
- name: Push changes
34+
uses: Woile/github-push-action@master
35+
with:
36+
github_token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
37+
tags: "true"

‎.github/workflows/pythonpublish.yaml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Upload Python Package
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
deploy:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up Python
14+
uses: actions/setup-python@v1
15+
with:
16+
python-version: '3.x'
17+
- name: Install dependencies
18+
run: |
19+
python -m pip install --pre -U poetry
20+
poetry --version
21+
poetry install
22+
- name: Build and publish
23+
env:
24+
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
25+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
26+
run: |
27+
./scripts/publish

‎scripts/deploy

-5
This file was deleted.

‎scripts/publish

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Publish to pypi
2+
poetry publish --build -u $PYPI_USERNAME -p $PYPI_PASSWORD
3+
4+
[ -z "${INPUT_GITHUB_TOKEN}" ] && {
5+
echo 'Missing input "github_token: ${{ secrets.GITHUB_TOKEN }}".';
6+
exit 1;
7+
};
8+
9+
remote_repo="https://${GITHUB_ACTOR}:${INPUT_GITHUB_TOKEN}@github.com/commitizen.git"
10+
11+
# Publish docs
12+
mkdocs gh-deploy --remote-name "${remote_repo}"

0 commit comments

Comments
 (0)