Skip to content

Commit dd3320e

Browse files
authored
ci: sync main with master branch (#2449)
1 parent 1b5f45c commit dd3320e

File tree

4 files changed

+46
-11
lines changed

4 files changed

+46
-11
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
- '*no-ci*'
88
push:
99
branches:
10-
- master
10+
- main
1111
workflow_dispatch:
1212
inputs:
1313
ansys_version:
@@ -148,7 +148,7 @@ jobs:
148148
if: |
149149
github.event.action != 'closed' &&
150150
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
151-
(startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
151+
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
152152
uses: ./.github/workflows/docs.yml
153153
needs: pick_server_suffix
154154
with:
@@ -183,7 +183,7 @@ jobs:
183183
if: |
184184
github.event.action != 'closed' &&
185185
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
186-
(github.ref == 'refs/heads/master' && github.event_name == 'push')
186+
(github.ref == 'refs/heads/main' && github.event_name == 'push')
187187
needs: [docs]
188188
steps:
189189
- name: "Upload development documentation"
@@ -200,7 +200,6 @@ jobs:
200200
if: |
201201
github.event.action != 'closed' &&
202202
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
203-
(startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
204203
uses: ./.github/workflows/examples.yml
205204
needs: pick_server_suffix
206205
with:
@@ -214,12 +213,12 @@ jobs:
214213
if: |
215214
github.event.action != 'closed' &&
216215
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
217-
(startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
216+
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
218217
uses: ./.github/workflows/pydpf-post.yml
219218
needs: pick_server_suffix
220219
with:
221220
ANSYS_VERSION: ${{ inputs.ansys_version || vars.ANSYS_VERSION_DEFAULT }}
222-
post_branch: "master"
221+
post_branch: "main"
223222
standalone_suffix: ${{needs.pick_server_suffix.outputs.suffix}}
224223
test_docstrings: "true"
225224
secrets: inherit
@@ -229,7 +228,7 @@ jobs:
229228
if: |
230229
github.event.action != 'closed' &&
231230
(github.event.action != 'labeled' || github.event.label.name == 'deploy-pr-doc') &&
232-
(startsWith(github.head_ref, 'master') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
231+
(startsWith(github.head_ref, 'main') || github.event.action == 'ready_for_review' || !github.event.pull_request.draft)
233232
strategy:
234233
fail-fast: false
235234
matrix:
@@ -248,3 +247,39 @@ jobs:
248247
DOCSTRING: false
249248
standalone_suffix: ${{ matrix.dpf.standalone-suffix }}
250249
secrets: inherit
250+
251+
sync-main-with-master:
252+
name: "Sync main with master"
253+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
254+
runs-on: ubuntu-latest
255+
steps:
256+
- name: "Install Git and clone project"
257+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
258+
with:
259+
token: ${{ secrets.GITHUB_TOKEN }}
260+
fetch-depth: 0
261+
262+
- name: "Verify that main is the default branch"
263+
shell: bash
264+
run: |
265+
head_branch=$(git remote show origin | grep "HEAD branch:")
266+
main_branch=${head_branch#*: }
267+
268+
if [[ $main_branch != "main" ]]; then
269+
echo "The default branch is not 'main'. It is set to '$main_branch'."
270+
echo "Please set 'main' as the default branch in the repository settings."
271+
exit 1
272+
fi
273+
274+
- name: "Configure git username and email"
275+
shell: bash
276+
run: |
277+
git config --global user.name "${{ secrets.PYANSYS_CI_BOT_USERNAME }}"
278+
git config --global user.email "${{ secrets.PYANSYS_CI_BOT_EMAIL }}"
279+
280+
- name: "Sync main to master"
281+
shell: bash
282+
run: |
283+
git checkout master
284+
git reset --hard main
285+
git push

.github/workflows/update_operators.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
branch: maint/update_code_for_${{ inputs.ANSYS_VERSION || vars.ANSYS_VERSION_DEFAULT }}${{ github.event.inputs.standalone_branch_suffix || '' }}_on_${{ github.ref_name }}
137137
labels: server-sync
138138
token: ${{ secrets.PYANSYS_CI_BOT_TOKEN }}
139-
reviewers: ${{ github.ref_name == 'master' && 'ansys/dpf_integration_proxies' || '' }}
139+
reviewers: ${{ github.ref_name == 'main' && 'ansys/dpf_integration_proxies' || '' }}
140140

141141
- name: "Kill all servers"
142142
uses: ansys/pydpf-actions/[email protected]

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[![docs](https://img.shields.io/website?down_color=lightgrey&down_message=invalid&label=documentation&up_color=brightgreen&up_message=up&url=https%3A%2F%2Fdpfdocs.pyansys.com%2F)](https://dpfdocs.pyansys.com)
88
[![MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
99
[![pypidl](https://img.shields.io/pypi/dm/ansys-dpf-core.svg?label=PyPI%20downloads)](https://pypi.org/project/ansys-dpf-core/)
10-
[![cov](https://codecov.io/gh/ansys/pydpf-core/branch/master/graph/badge.svg)](https://codecov.io/gh/ansys/pydpf-core)
10+
[![cov](https://codecov.io/gh/ansys/pydpf-core/branch/main/graph/badge.svg)](https://codecov.io/gh/ansys/pydpf-core)
1111
[![codacy](https://app.codacy.com/project/badge/Grade/61b6a519aea64715ad1726b3955fcf98)](https://www.codacy.com/gh/ansys/pydpf-core/dashboard?utm_source=github.com&utm_medium=referral&utm_content=ansys/pydpf-core&utm_campaign=Badge_Grade)
1212

1313
Ansys Data Processing Framework (DPF) provides numerical simulation
@@ -187,7 +187,7 @@ module. It closes when you exit Python or connect to a different server.
187187
## License and acknowledgments
188188

189189
PyDPF-Core is licensed under the MIT license. For more information, see the
190-
[LICENSE](https://github.com/ansys/pydpf-post/raw/master/LICENSE) file.
190+
[LICENSE](https://github.com/ansys/pydpf-post/raw/main/LICENSE) file.
191191

192192
PyDPF-Core makes no commercial claim over Ansys whatsoever. This library
193193
extends the functionality of Ansys DPF by adding a Python interface

src/ansys/dpf/core/examples/downloads.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
GITHUB_SOURCE_URL = (
4040
"https://github.com/ansys/pydpf-core/raw/"
41-
"master/doc/source/examples/07-python-operators/plugins/"
41+
"main/doc/source/examples/07-python-operators/plugins/"
4242
)
4343

4444

0 commit comments

Comments
 (0)