|
1 | | -name: publish-and-release |
| 1 | +name: Create Release Commit |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
5 | 5 | inputs: |
6 | | - release: |
| 6 | + release-tag: |
7 | 7 | description: "Release tag (e.g. 3.2.1)" |
8 | | - release-again: |
9 | | - description: "Just checking." |
| 8 | + required: true |
| 9 | + type: string |
10 | 10 |
|
11 | 11 | jobs: |
12 | | - build-and-test: |
13 | | - name: "Build and Test distribution" |
14 | | - runs-on: ubuntu-latest |
15 | | - if: ${{ inputs.release == inputs.release-again }} |
16 | | - steps: |
17 | | - - uses: actions/checkout@v4 |
18 | | - - uses: actions/setup-python@v5 |
19 | | - with: |
20 | | - python-version: "3.9" |
21 | | - |
22 | | - - name: "Prepare build environment" |
23 | | - run: | |
24 | | - pip install --user python-minifier wheel setuptools |
25 | | -
|
26 | | - - name: "Build and Check distribution" |
27 | | - run: | |
28 | | - make dist |
29 | | - .github/scripts/dist-health-check.sh |
30 | | -
|
31 | | - - name: Save dist files |
32 | | - uses: actions/upload-artifact@v3 |
33 | | - with: |
34 | | - name: dist-folder |
35 | | - path: dist |
36 | | - if-no-files-found: "error" |
37 | | - |
38 | | - create-release-commit: |
39 | | - name: "Create and push release commit, post-release" |
40 | | - needs: "build-and-test" |
41 | | - runs-on: ubuntu-latest |
42 | | - steps: |
43 | | - - uses: actions/checkout@v4 |
44 | | - - uses: actions/setup-python@v5 |
45 | | - with: |
46 | | - python-version: "3.9" |
47 | | - |
48 | | - - name: "Prepare release tools" |
49 | | - run: | |
50 | | - pip install --user git-changelog |
51 | | -
|
52 | | - - name: "Bump Versions, update changelog and create release-commit" |
53 | | - run: | |
54 | | - .github/scripts/create-release-commit.sh {{ github.event.input.release}} |
55 | | -
|
56 | | - - name: "Push commit to master" |
57 | | - run: | |
58 | | - echo "Pushing commit to master" |
59 | | - git log --oneline -5 |
60 | | - git show HEAD |
61 | | -
|
62 | | -
|
63 | | - pypi-publish: |
64 | | - name: "Upload release to PyPI" |
65 | | - needs: create-release-commit |
66 | | - runs-on: ubuntu-latest |
67 | | - environment: |
68 | | - name: pypi |
69 | | - url: https://pypi.org/p/dynaconf |
70 | | - permissions: |
71 | | - id-token: write # IMPORTANT: this permission is mandatory for trusted publishing |
72 | | - steps: |
73 | | - - name: Get distribution |
74 | | - uses: actions/download-artifact@v3 |
75 | | - with: |
76 | | - name: dist-folder |
77 | | - path: dist |
78 | | - |
79 | | - - name: Test publish |
80 | | - run: | |
81 | | - tree dist |
82 | | -
|
83 | | - # - name: Publish package distributions to PyPI |
84 | | - # uses: pypa/gh-action-pypi-publish@release/v1 |
85 | | - |
86 | | - github-release: |
87 | | - name: Create GitHub Release |
88 | | - needs: pypi-publish |
89 | | - runs-on: ubuntu-latest |
90 | | - steps: |
91 | | - - name: Checkout |
92 | | - uses: actions/checkout@v4 |
93 | | - |
94 | | - - name: Setup Python |
95 | | - uses: actions/setup-python@v5 |
96 | | - |
97 | | - - name: Install git-changelog |
98 | | - run: pip install git-changelog |
99 | | - |
100 | | - - name: Prepare release notes |
101 | | - run: | |
102 | | - git-changelog --release-notes > release-notes.md |
103 | | - echo "Release notes being used:" |
104 | | - cat release-notes.md |
105 | | -
|
106 | | - # - name: Create GitHub release |
107 | | - # uses: softprops/action-gh-release@v1 |
108 | | - # with: |
109 | | - # body_path: release-notes.md |
| 12 | + # Create "VCS release" |
| 13 | + release-commit: |
| 14 | + name: "Create release commits" |
| 15 | + description: | |
| 16 | + Creates and pushes the commits: |
| 17 | + 1. tagged release commit with changelog updates |
| 18 | + 2. post-release commit with next version bump |
| 19 | + uses: ./.github/workflows/release__create-commit.yml |
| 20 | + with: |
| 21 | + release-tag: ${{ inputs.release-tag }} |
| 22 | + secrets: inherit |
| 23 | + |
| 24 | + # Generate release artifacats |
| 25 | + build-dist: |
| 26 | + name: "Build distribution" |
| 27 | + uses: ./.github/workflows/main__build-dist.yml |
| 28 | + with: |
| 29 | + artifact_out: "dist-folder" |
| 30 | + |
| 31 | + build-docs: |
| 32 | + name: "Build documentation" |
| 33 | + uses: ./.github/workflows/main__build-docs.yml |
| 34 | + with: |
| 35 | + artifact_out: "docs-site" |
| 36 | + |
| 37 | + # Push to prod |
| 38 | + publish-pypi: |
| 39 | + name: "Publish to PyPI" |
| 40 | + needs: build-dist |
| 41 | + uses: ./.github/workflows/release__publish-pypi.yml |
| 42 | + with: |
| 43 | + artifact_in: "dist-folder" |
| 44 | + release-tag: ${{ inputs.release-tag }} |
| 45 | + secrets: inherit |
| 46 | + |
| 47 | + publish-github: |
| 48 | + name: "Publish to GitHub" |
| 49 | + needs: publish-pypi |
| 50 | + uses: ./.github/workflows/release__publish-github.yml |
| 51 | + with: |
| 52 | + release-tag: ${{ inputs.release-tag }} |
| 53 | + secrets: inherit |
| 54 | + |
| 55 | + publish-docs: |
| 56 | + name: "Publish documentation" |
| 57 | + needs: |
| 58 | + - docs-build |
| 59 | + - publish-pypi |
| 60 | + uses: ./.github/workflows/release__publish-docs.yml |
| 61 | + with: |
| 62 | + artifact_in: "docs-site" |
| 63 | + release-tag: ${{ inputs.release-tag }} |
| 64 | + secrets: inherit |
0 commit comments