Skip to content

Commit fdaaf68

Browse files
authored
Merge pull request #943 from effigies/pre-main
chore: Accept main where master is used
2 parents c0caa62 + 920f8ea commit fdaaf68

File tree

6 files changed

+28
-25
lines changed

6 files changed

+28
-25
lines changed

.circleci/config.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ jobs:
5555
- build-v1--{{ .Revision }}
5656
- build-v1-{{ .Branch }}-
5757
- build-v1-master-
58+
- build-v1-main-
5859
- build-v1-
5960
paths:
6061
- /tmp/docker
@@ -141,6 +142,7 @@ jobs:
141142
keys:
142143
- data-v3-{{ .Branch }}-
143144
- data-v3-master-
145+
- data-v3-main-
144146
- data-v3-
145147
- run:
146148
name: Get test data from ds000003
@@ -211,6 +213,7 @@ jobs:
211213
keys:
212214
- data-v3-{{ .Branch }}-
213215
- data-v3-master-
216+
- data-v3-main-
214217

215218
- run:
216219
name: Run unit tests

.github/workflows/codespell.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ name: Codespell
33

44
on:
55
push:
6-
branches: [master]
6+
branches: [master, main]
77
pull_request:
8-
branches: [master]
8+
branches: [master, main]
99

1010
jobs:
1111
codespell:

.github/workflows/docs-build-pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build docs
33

44
on:
55
pull_request:
6-
branches: [ master, 'maint/*' ]
6+
branches: [ master, main, 'maint/*' ]
77

88
jobs:
99
build:

.github/workflows/docs-build-update.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Build & update docs
33

44
on:
55
push:
6-
branches: [ 'doc/*', 'docs/*', master, "maint/*" ]
6+
branches: [ 'doc/*', 'docs/*', master, main, "maint/*" ]
77
tags: [ '*' ]
88

99
jobs:
@@ -67,18 +67,18 @@ jobs:
6767
git commit -m "rel(${CURBRANCH}): Update docs of ${MAJOR_MINOR} series" || true
6868
git push
6969
70-
- name: Push "master" docs to gh-pages after a PR is merged
71-
if: github.ref == 'refs/heads/master'
70+
- name: Push "main" docs to gh-pages after a PR is merged
71+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
7272
run: |
73-
if [[ "${CURBRANCH}" != "master" ]]; then
73+
if [[ "${CURBRANCH}" != "master" -a "${CURBRANCH}" != "main" ]]; then
7474
echo "$CURBRANCH is not the default development branch"
7575
exit 1
7676
fi
7777
git checkout -b gh-pages origin/gh-pages
78-
git rm -r master/ || true
78+
git rm -r ${CURBRANCH}/ || true
7979
# It is fundamental that the directory does not exist at all.
80-
rm -rf master
81-
cp -r $HOME/docs/$CURBRANCH $PWD/master
82-
git add master
83-
git commit -am "docs(master): Update docs of development line" || true
80+
rm -rf ${CURBRANCH}
81+
cp -r $HOME/docs/$CURBRANCH $PWD/${CURBRANCH}
82+
git add ${CURBRANCH}
83+
git commit -am "docs(${CURBRANCH}): Update docs of development line" || true
8484
git push

.github/workflows/tox.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches: [ '**' ]
66
tags: [ '*' ]
77
pull_request:
8-
branches: [ master, 'maint/*' ]
8+
branches: [ master, main, 'maint/*' ]
99
schedule:
1010
- cron: '0 0 * * *'
1111

docs/_static/js/version-switch.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
$(document).ready(function() {
2-
var pathname = window.location.pathname;
3-
var cur_ver = $("#version-slug").text().replace(/^[\n\s]+|[\n\s]+$/g, '')
4-
var major_minor = "master";
2+
const pathname = window.location.pathname;
3+
const cur_ver = $("#version-slug").text().replace(/^[\n\s]+|[\n\s]+$/g, '')
4+
let major_minor = "master";
55
if ( cur_ver.lastIndexOf(" (dev)") == -1 ) {
66
major_minor = `${cur_ver.split('.')[0]}.${cur_ver.split('.')[1]}`
77
}
8-
var relpath = pathname.substring(pathname.lastIndexOf(major_minor)).replace(/\/$/, '');
9-
var levels = relpath.split("/").length - 1
8+
let relpath = pathname.substring(pathname.lastIndexOf(major_minor)).replace(/\/$/, '');
9+
let levels = relpath.split("/").length - 1
1010
if ( levels == 0 ) {
1111
levels = 1
1212
relpath += "/"
1313
}
14-
var versions_file = "../".repeat(levels) + "versions.json"
14+
const versions_file = "../".repeat(levels) + "versions.json"
1515
relpath = "../".repeat(levels) + relpath
1616
relpath = relpath.replace("//", "/")
1717
console.log(`relpath="${relpath}", cur_ver="${cur_ver}"`)
@@ -20,22 +20,22 @@ $(document).ready(function() {
2020
$("#version-slug").remove(); // Unnecessary if JSON was downloaded
2121

2222
$.each(data["tags"].reverse(), function( i, val ) {
23-
var new_path = relpath.replace(major_minor, val)
24-
var item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val}</a></li>`
23+
const new_path = relpath.replace(major_minor, val)
24+
let item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val}</a></li>`
2525
if ( i == 0 ) {
2626
item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val} (Latest Release)</a></li>`
2727
}
2828
$("#v-tags").append(item)
2929
});
3030
$.each(data["heads"].reverse(), function( i, val ) {
31-
var new_path = relpath.replace(major_minor, val)
32-
var item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val}</a></li>`
33-
if ( val == "master" ) {
31+
const new_path = relpath.replace(major_minor, val)
32+
let item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val}</a></li>`
33+
if ( ["master", "main"].includes(val) ) {
3434
item = `<li class="toctree-l2"><a class="reference internal" href="${new_path}">${val} (Development)</a></li>`
3535
}
3636
$("#v-tags").append(item)
3737
});
3838
}).fail(function() {
3939
$("#version-menu").hide(); // JSON download failed - hide dropdown
4040
});
41-
});
41+
});

0 commit comments

Comments
 (0)