-
Notifications
You must be signed in to change notification settings - Fork 10
58 lines (48 loc) · 1.55 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
name: CD
on:
workflow_dispatch:
push:
branches:
- "main"
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get version from file
run: |
VERSION_FILE="$/navix/_version.py"
NAVIX_VERSION="$(cat navix/_version.py | grep '__version__ = ' | cut -d'=' -f2 | sed 's,\",,g' | sed "s,\',,g" | sed 's, ,,g')"
echo "Current version is:"
echo "$NAVIX_VERSION"
echo "NAVIX_VERSION=$NAVIX_VERSION" >> $GITHUB_ENV
- name: Create changelog and push tag
id: changelog
uses: TriPSs/conventional-changelog-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
output-file: false
fallback-version: ${{ env.NAVIX_VERSION }}
skip-commit: true
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ env.NAVIX_VERSION }}
name: "NAVIX release v${{ env.NAVIX_VERSION }}"
body: ${{ steps.changelog.outputs.clean_changelog }}
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install pypa/build
run: |
python -m pip install build
- name: Build wheel and sdist
run: |
python -m build --sdist --wheel --outdir dist/ .
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
verbose: true
password: ${{ secrets.PYPI_API_KEY }}