|
4 | 4 | pull_request:
|
5 | 5 | types:
|
6 | 6 | - closed
|
| 7 | + branches: |
| 8 | + - release/** |
| 9 | + - prerelease/** |
7 | 10 |
|
8 | 11 | jobs:
|
9 | 12 | release:
|
10 | 13 | name: Release
|
11 |
| - if: ${{ github.event.pull_request.merged && startsWith(github.head_ref, 'release/') }} |
| 14 | + if: ${{ github.event.pull_request.merged }} |
12 | 15 | runs-on: ubuntu-latest
|
13 | 16 | steps:
|
14 | 17 | - uses: actions/checkout@v2
|
15 | 18 | with:
|
16 | 19 | token: ${{ secrets.GH_ACCESS_TOKEN_TOM }}
|
17 | 20 |
|
18 | 21 | - id: get-version
|
19 |
| - run: echo "version=$(echo ${{ github.head_ref }} | sed 's|release/||')" >> "$GITHUB_OUTPUT" |
| 22 | + run: echo "version=$(echo ${{ github.head_ref }} | sed -E 's|^(release/|prerelease/)||')" >> "$GITHUB_OUTPUT" |
| 23 | + |
| 24 | + - id: get-title-prefix |
| 25 | + run: echo "prefix=$([ ${{ startsWith(github.head_ref, 'prerelease/') }} ] && echo 'Prerelease' || echo 'Release')" >> "$GITHUB_OUTPUT" |
20 | 26 |
|
21 | 27 | - name: Use Node 22
|
22 | 28 | uses: actions/setup-node@v3
|
|
36 | 42 |
|
37 | 43 | - name: Update docs requirements
|
38 | 44 | run: just _set-docs-version ${{ steps.get-version.outputs.version }}
|
| 45 | + if: ${{ startswith(github.head_ref, 'release/') }} |
39 | 46 |
|
40 | 47 | - name: Build dash-bootstrap-components
|
41 | 48 | run: just build
|
|
53 | 60 | - name: Commit updated package-lock.json and docs requirements
|
54 | 61 | uses: stefanzweifel/git-auto-commit-action@v4
|
55 | 62 | with:
|
56 |
| - commit_message: Release ${{ steps.get-version.outputs.version }} |
| 63 | + commit_message: ${{ steps.get-title-prefix.outputs.prefix }} ${{ steps.get-version.outputs.version }} |
57 | 64 | branch: main
|
58 | 65 | push_options: --force
|
59 | 66 | file_pattern: package-lock.json docs/requirements.txt
|
|
65 | 72 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
66 | 73 | with:
|
67 | 74 | tag_name: ${{ steps.get-version.outputs.version }}
|
68 |
| - release_name: Release ${{ steps.get-version.outputs.version }} |
69 |
| - body: ${{ github.event.pull_request.body }} |
70 |
| - prerelease: false |
71 |
| - |
72 |
| - - name: Post-release cleanup |
73 |
| - run: just postrelease ${{ steps.get-version.outputs.version }} |
74 |
| - |
75 |
| - - uses: stefanzweifel/git-auto-commit-action@v4 |
76 |
| - with: |
77 |
| - commit_message: Back to dev |
78 |
| - branch: main |
79 |
| - push_options: --force |
80 |
| - file_pattern: package.json tests/test_version.py dash_bootstrap_components/_version.py |
81 |
| - |
82 |
| - prerelease: |
83 |
| - name: Prerelease |
84 |
| - if: ${{ github.event.pull_request.merged && startsWith(github.head_ref, 'prerelease/') }} |
85 |
| - runs-on: ubuntu-latest |
86 |
| - steps: |
87 |
| - - uses: actions/checkout@v2 |
88 |
| - with: |
89 |
| - token: ${{ secrets.GH_ACCESS_TOKEN_TOM }} |
90 |
| - |
91 |
| - - id: get-version |
92 |
| - run: echo "version=$(echo ${{ github.head_ref }} | sed 's|prerelease/||')" >> "$GITHUB_OUTPUT" |
93 |
| - |
94 |
| - - name: Use Node 22 |
95 |
| - uses: actions/setup-node@v3 |
96 |
| - with: |
97 |
| - node-version: 22 |
98 |
| - |
99 |
| - - name: Install the latest version of uv |
100 |
| - uses: astral-sh/setup-uv@v3 |
101 |
| - with: |
102 |
| - version: 'latest' |
103 |
| - |
104 |
| - - name: Install just |
105 |
| - uses: extractions/setup-just@v2 |
106 |
| - |
107 |
| - - name: Install JS dependencies |
108 |
| - run: npm ci |
109 |
| - |
110 |
| - - name: Build dash-bootstrap-components |
111 |
| - run: just build |
112 |
| - |
113 |
| - - uses: JS-DevTools/npm-publish@v1 |
114 |
| - with: |
115 |
| - token: ${{ secrets.NPM_TOKEN }} |
116 |
| - |
117 |
| - - name: Publish to PyPI |
118 |
| - uses: pypa/gh-action-pypi-publish@v1.12.3 |
119 |
| - with: |
120 |
| - password: ${{ secrets.PYPI_API_TOKEN }} |
121 |
| - packages-dir: py-dist/ |
122 |
| - |
123 |
| - - name: Commit updated package-lock.json |
124 |
| - uses: stefanzweifel/git-auto-commit-action@v4 |
125 |
| - with: |
126 |
| - commit_message: Release ${{ steps.get-version.outputs.version }} |
127 |
| - branch: main |
128 |
| - push_options: --force |
129 |
| - file_pattern: package-lock.json |
130 |
| - |
131 |
| - - name: Create GitHub prerelease |
132 |
| - id: create-prerelease |
133 |
| - uses: actions/create-release@v1 |
134 |
| - env: |
135 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
136 |
| - with: |
137 |
| - tag_name: ${{ steps.get-version.outputs.version }} |
138 |
| - release_name: Prerelease ${{ steps.get-version.outputs.version }} |
| 75 | + release_name: ${{ steps.get-title-prefix.outputs.prefix }} ${{ steps.get-version.outputs.version }} |
139 | 76 | body: ${{ github.event.pull_request.body }}
|
140 |
| - prerelease: true |
| 77 | + prerelease: ${{ startsWith(github.head_ref, 'prerelease/') }} |
141 | 78 |
|
142 | 79 | - name: Post-release cleanup
|
143 | 80 | run: just postrelease ${{ steps.get-version.outputs.version }}
|
|
147 | 84 | commit_message: Back to dev
|
148 | 85 | branch: main
|
149 | 86 | push_options: --force
|
150 |
| - file_pattern: package.json tests/test_version.py dash_bootstrap_components/_version.py |
| 87 | + file_pattern: package.json tests/test_version.py dash_bootstrap_components/_version.py uv.lock |
0 commit comments