-
-
Notifications
You must be signed in to change notification settings - Fork 2
83 lines (70 loc) · 2.17 KB
/
cd.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: Continuous Deployment
on:
push:
tags:
- 'v*.*.*'
jobs:
deploy:
name: Deploy and release
runs-on: ubuntu-22.04
permissions:
contents: write
env:
GIT_PAGER: cat
GIT_AUTHOR_NAME: github-actions
GIT_AUTHOR_EMAIL: [email protected]
steps:
- name: Checkout dōteki
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Poetry
run: pip install poetry
- name: Configure PyPI token
run: poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }}
- name: Generate the changelog
uses: orhun/git-cliff-action@main
id: git-cliff
with:
config: cliff.toml
args: --latest --strip all
env:
OUTPUT: CHANGES.md
# - name: Publish to PyPI
# run: poetry publish --build
- name: Create GitHub release
run: |
gh release create ${{ github.ref_name }} \
--title "Release ${{ github.ref_name }}" \
--notes "${{ steps.git-cliff.outputs.content }}"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Update doteki-action.
- name: Clone doteki-action
uses: actions/checkout@v4
with:
repository: 'welpo/doteki-action'
fetch-depth: 0
token: ${{ secrets.ACTIONS_ACCESS_TOKEN }}
path: 'doteki-action'
- name: Update dōteki version in doteki-action
run: |
cd doteki-action
sed -i "s/doteki\[all\]==[0-9]*\.[0-9]*\.[0-9]*/doteki[all]==${{ github.ref_name }}/g" action.yaml
git add action.yaml
git commit -m "⬆️️ feat: update dōteki to ${{ github.ref_name }}"
- name: Install git-cliff
run: pip install git-cliff
- name: Run release script in doteki-action
run: |
cd doteki-action
bash release ${{ github.ref_name }}
- name: Push changes and tags to doteki-action
run: |
cd doteki-action
git push origin main
git push origin --tags