-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (80 loc) · 3.46 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
name: Release
on:
push:
branches: [main]
jobs:
release-please:
name: Create release PR
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
release-type: python
package-name: blitzly
prerelease: true
default-branch: main
pull-request-header: ":robot: I have created a release *beep* *boop*. This was predictable."
changelog-types: '[{"type":"maintain","section":"Maintenance","hidden":false},{"type":"resolve","section":"Miscellaneous","hidden":true},{"type":"add","section":"Features","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"bug","section":"Bug Fixes","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":true},{"type":"test","section":"Tests","hidden":false},{"type":"ci","section":"CI/CD","hidden":false},{"type":"refactor","section":"Maintenance","hidden":false},{"type":"perf","section":"Maintenance","hidden":false},{"type":"revert","section":"Maintenance","hidden":true},{"type":"docs","section":"Documentation","hidden":false},{"type":"security","section":"Security","hidden":false}]'
deploy-package:
if: ${{ startsWith(github.event.head_commit.message, 'chore(main)') }}
name: Deploy package to PyPI
needs: release-please
runs-on: ubuntu-latest
environment: deploy-package
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: |
curl -O -sSL https://install.python-poetry.org/install-poetry.py
python install-poetry.py -y --version 1.3.2
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
rm install-poetry.py
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- run: poetry env use python3.10
- run: poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
- run: poetry publish --build
deploy-docs:
name: Deploy documentation
needs: deploy-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install poetry
run: |
curl -O -sSL https://install.python-poetry.org/install-poetry.py
python install-poetry.py -y --version 1.3.2
echo "PATH=${HOME}/.poetry/bin:${PATH}" >> $GITHUB_ENV
rm install-poetry.py
- uses: actions/setup-python@v4
with:
python-version: "3.10"
cache: "poetry"
- run: poetry env use python3.10
- run: poetry install --with docs
- run: poetry run mkdocs gh-deploy --force --clean --verbose
fast-forward-merge-pr:
name: Create fast-forward merge PR
needs: deploy-package
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
ref: develop
- name: Reset main branch
run: |
git fetch origin main:main
git reset --hard main
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
branch: temp-main
base: develop
delete-branch: true
title: "resolve: fast-forward merge `main` into `develop`"
body: |
ℹ️ ℹ️ ℹ️
This pull request was created automatically by a GitHub Action to fast-forward-merge the `main` branch into `develop`.
it will be automatically merged. You don't need to do anything. Have a 🍪 and enjoy this automation!