-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.66 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: Release
on: workflow_dispatch
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout Code
uses: actions/checkout@v3
- name: Configure Git User
run: |
git config user.email "[email protected]"
git config user.name "GitHub Actions"
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
pip install wheel
- name: Build release
run: |
python setup.py sdist bdist_wheel
- name: Get next release candidate
id: next-release
run: |
NEXT_RELEASE=$(grep 'version=' setup.py | sed 's/version="//' | sed 's/",//' | xargs)
echo "NEXT_RELEASE=$NEXT_RELEASE" >> $GITHUB_ENV
shell: bash
- name: Create tag for release
run: |
git tag ${{ env.NEXT_RELEASE }}
git push origin ${{ env.NEXT_RELEASE }}
- name: Create new minor release
run: .github/scripts/release.py --release ${{ env.NEXT_RELEASE }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload to Nexus
run: |
python -m twine upload --repository-url https://tnt.autentia.com/nexus/repository/autentia-pypi/ dist/* -u ${{ secrets.NEXUS_REPOSITORY_USER }} -p ${{ secrets.NEXUS_REPOSITORY_PASSWORD }}
- name: Update version in remote
run: |
git add setup.py
git commit -m "[skip ci] chore: prepare next release candidate"
git push