-
-
Notifications
You must be signed in to change notification settings - Fork 290
109 lines (91 loc) · 2.72 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: publish-and-release
on:
workflow_dispatch:
inputs:
release:
description: "Release tag (e.g. 3.2.1)"
release-again:
description: "Just checking."
jobs:
build-and-test:
name: "Build and Test distribution"
runs-on: ubuntu-latest
if: ${{ inputs.release == inputs.release-again }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: "Prepare build environment"
run: |
pip install --user python-minifier wheel setuptools
- name: "Build and Check distribution"
run: |
make dist
.github/scripts/dist-health-check.sh
- name: Save dist files
uses: actions/upload-artifact@v3
with:
name: dist-folder
path: dist
if-no-files-found: "error"
create-release-commit:
name: "Create and push release commit, post-release"
needs: "build-and-test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: "Prepare release tools"
run: |
pip install --user git-changelog
- name: "Bump Versions, update changelog and create release-commit"
run: |
.github/scripts/create-release-commit.sh {{ github.event.input.release}}
- name: "Push commit to master"
run: |
echo "Pushing commit to master"
git log --oneline -5
git show HEAD
pypi-publish:
name: "Upload release to PyPI"
needs: create-release-commit
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/dynaconf
permissions:
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
steps:
- name: Get distribution
uses: actions/download-artifact@v3
with:
name: dist-folder
path: dist
- name: Test publish
run: |
tree dist
# - name: Publish package distributions to PyPI
# uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: Create GitHub Release
needs: pypi-publish
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
- name: Install git-changelog
run: pip install git-changelog
- name: Prepare release notes
run: |
git-changelog --release-notes > release-notes.md
echo "Release notes being used:"
cat release-notes.md
# - name: Create GitHub release
# uses: softprops/action-gh-release@v1
# with:
# body_path: release-notes.md