-
Notifications
You must be signed in to change notification settings - Fork 2
107 lines (105 loc) · 3.63 KB
/
workflow.yml
File metadata and controls
107 lines (105 loc) · 3.63 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
name: Workflow
on:
push:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10.12'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run tests
run: pytest
tag:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: "✏️ Bump version and push tag"
id: tagging
uses: anothrNick/github-tag-action@1.36.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: false
- name: "🖨️ Print new tag to console"
run: |
echo ${{steps.tagging.outputs.new_tag}}
- name: "Update repo"
run: |
sudo chmod -R 777 .git
git fetch --prune --unshallow
- name: "Bump version file"
run: |
sed -ie "s/__version__ = \"*.*.*\"/__version__ = \"${{steps.tagging.outputs.new_tag}}\"/" gpao/__init__.py
- name: "✏️ Generate full changelog"
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
headerLabel: "# 📑 Changelog"
breakingLabel: '### 💥 Breaking'
enhancementLabel: '### 🚀 Enhancements'
bugsLabel: '### 🐛 Bug fixes'
deprecatedLabel: '### ⚠️ Deprecations'
removedLabel: '### 🔥 Removals'
securityLabel: '### 🛡️ Security'
issuesLabel: '### 📁 Other issues'
prLabel: '### 📁 Other pull requests'
addSections: '{"documentation":{"prefix":"### 📖 Documentation","labels":["documentation"]},"tests":{"prefix":"### ✅ Testing","labels":["tests"]}}'
issues: true
issuesWoLabels: true console.log(`${req.app.get('apiUrl')}/api/jobs/status`) console.log(`${req.app.get('apiUrl')}/api/jobs/status`)
pullRequests: true
prWoLabels: true
author: true
unreleased: true
compareLink: true
stripGeneratorNotice: true
verbose: true
- name: "🖨️ Print changelog to console"
run: cat CHANGELOG.md
- name: "📤 Commit files"
run: |
git config --local user.email "action@github.com"
git config --local user.name "github-actions[bot]"
git pull
git add CHANGELOG.md gpao/__init__.py
git commit -m "[bot] Update changelog and version"
git push
git tag -d ${{steps.tagging.outputs.new_tag}}
git push origin :${{steps.tagging.outputs.new_tag}}
git tag ${{steps.tagging.outputs.new_tag}}
git push origin ${{steps.tagging.outputs.new_tag}}
- name: "Update repo"
run: |
git fetch --prune
- name: "✏️ Generate release changelog"
id: generate-release-changelog
uses: heinrichreimer/github-changelog-generator-action@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
onlyLastTag: "true"
stripHeaders: "true"
stripGeneratorNotice: "true"
- name: "🚀 Create GitHub release"
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{steps.tagging.outputs.new_tag}}
name: Release ${{steps.tagging.outputs.new_tag}}
body: ${{ steps.generate-release-changelog.outputs.changelog }}
- name: Build and publish
run: |
pip install twine
python setup.py sdist bdist_wheel
twine check dist/*
- name: Publish Python package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
password: ${{ secrets.PYPI_API_TOKEN }}