forked from autoscrape-labs/pydoll
-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (80 loc) · 2.46 KB
/
release.yml
File metadata and controls
90 lines (80 loc) · 2.46 KB
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Release
on: workflow_dispatch
jobs:
version-cz:
runs-on: ubuntu-latest
name: "Version CZ"
permissions:
contents: write
outputs:
version: ${{ steps.cz.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- id: cz
name: Create bump and changelog
uses: commitizen-tools/commitizen-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Print Version
run: echo "Bumped to version ${{ steps.cz.outputs.version }}"
version-pyproject:
runs-on: ubuntu-latest
name: "Version Pyproject"
needs: version-cz
permissions:
contents: write
outputs:
version: ${{ needs.version-cz.outputs.version }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install Poetry
run: |
python -m pip install --upgrade pip
pip install poetry
- name: Update Poetry version in pyproject.toml
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
poetry version "${{ needs.version-cz.outputs.version }}"
git add pyproject.toml
git commit -m "Update pyproject.toml to version ${{ needs.version-cz.outputs.version }}"
git pull --rebase
git push
- name: Update poetry.lock
continue-on-error: true
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
poetry lock
git add poetry.lock
git commit -m "Update poetry.lock"
git pull --rebase
git push
release:
name: Release
needs: version-pyproject
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Create Release
uses: softprops/action-gh-release@v2
with:
draft: false
prerelease: false
generate_release_notes: true
tag_name: ${{ needs.version-pyproject.outputs.version }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}