You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tutorials/github_actions.md
+48-22Lines changed: 48 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -7,12 +7,12 @@ the new tag, back to your master branch, we have to:
7
7
8
8
1. Create a personal access token. [Follow the instructions here](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line#creating-a-token). And copy the generated key
9
9
2. Create a secret called `PERSONAL_ACCESS_TOKEN`, with the copied key, by going to your
10
-
project repository and then `Settings > Secrets > Add new secret`.
10
+
project repository and then `Settings > Secrets > Add new secret`.
11
11
3. In your repository create a new file `.github/workflows/bumpversion.yml`
12
-
with the following content.
12
+
with the following content.
13
13
14
14
!!! warning
15
-
If you use `GITHUB_TOKEN` instead of `PERSONAL_ACCESS_TOKEN`, the job won't trigger another workflow. It's like using `[skip ci]` in other CI's.
15
+
If you use `GITHUB_TOKEN` instead of `PERSONAL_ACCESS_TOKEN`, the job won't trigger another workflow. It's like using `[skip ci]` in other CI's.
Once the new tag is created, triggering an automatic publish command would be desired.
@@ -62,28 +88,28 @@ name: Upload Python Package
62
88
on:
63
89
push:
64
90
tags:
65
-
- '*'# Will trigger for every tag, alternative: 'v*'
91
+
- "*" # Will trigger for every tag, alternative: 'v*'
66
92
67
93
jobs:
68
94
deploy:
69
95
runs-on: ubuntu-latest
70
96
steps:
71
-
- uses: actions/checkout@v1
72
-
- name: Set up Python
73
-
uses: actions/setup-python@v1
74
-
with:
75
-
python-version: '3.x'
76
-
- name: Install dependencies
77
-
run: |
78
-
python -m pip install --pre -U poetry
79
-
poetry --version
80
-
poetry install
81
-
- name: Build and publish
82
-
env:
83
-
PYPI_USERNAME: __token__
84
-
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
85
-
run: |
86
-
./scripts/publish
97
+
- uses: actions/checkout@v1
98
+
- name: Set up Python
99
+
uses: actions/setup-python@v1
100
+
with:
101
+
python-version: "3.x"
102
+
- name: Install dependencies
103
+
run: |
104
+
python -m pip install --pre -U poetry
105
+
poetry --version
106
+
poetry install
107
+
- name: Build and publish
108
+
env:
109
+
PYPI_USERNAME: __token__
110
+
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
111
+
run: |
112
+
./scripts/publish
87
113
```
88
114
89
115
Notice that we are calling a bash script in `./scripts/publish`, you should configure it with your tools (twine, poetry, etc.). Check [commitizen example](https://github.com/commitizen-tools/commitizen/blob/master/scripts/publish)
0 commit comments