Skip to content

Commit 5d101e5

Browse files
authored
ci: adapt workflows in preparation for 3.0 (#12026)
1 parent 79c79ff commit 5d101e5

4 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/utils/promote_unstable_docs_docusaurus.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@
2323
sys.exit("Version must be formatted like so <major>.<minor>")
2424

2525
target_version = f"{args.version}" # e.g., "2.20" - the target release version
26-
major, minor = args.version.split(".")
2726

2827
target_unstable = f"{target_version}-unstable" # e.g., "2.20-unstable"
29-
previous_stable = f"{major}.{int(minor) - 1}" # e.g., "2.19" - previous stable release
3028

3129
versions = [
3230
folder.replace("version-", "")
@@ -83,9 +81,15 @@
8381
with open("docs-website/reference_versions.json", "w") as f:
8482
json.dump(reference_versions_list, f)
8583

86-
# in docusaurus.config.js, replace previous stable version with the target version
84+
# in docusaurus.config.js, replace the current stable version (lastVersion) with the target version
8785
with open("docs-website/docusaurus.config.js") as f:
8886
config = f.read()
87+
last_version_matches = set(re.findall(r"lastVersion: '([^']+)'", config))
88+
if not last_version_matches:
89+
sys.exit("Could not find any lastVersion entry in docusaurus.config.js")
90+
if len(last_version_matches) > 1:
91+
sys.exit(f"Found inconsistent lastVersion entries in docusaurus.config.js: {last_version_matches}")
92+
previous_stable = last_version_matches.pop() # e.g., "2.19" - previous stable release
8993
config = config.replace(f"lastVersion: '{previous_stable}'", f"lastVersion: '{target_version}'") # "2.19" -> "2.20"
9094
with open("docs-website/docusaurus.config.js", "w") as f:
9195
f.write(config)

.github/workflows/docker_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
- 'pyproject.toml'
1313
- 'VERSION.txt'
1414
tags:
15-
- "v2.[0-9]+.[0-9]+*"
15+
- "v[0-9]+.[0-9]+.[0-9]+*"
1616

1717
env:
1818
DOCKER_REPO_NAME: deepset/haystack
@@ -52,7 +52,7 @@ jobs:
5252

5353
- name: Detect stable version
5454
run: |
55-
if [[ "${{ steps.meta.outputs.version }}" =~ ^v2\.[0-9]+\.[0-9]+$ ]]; then
55+
if [[ "${{ steps.meta.outputs.version }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
5656
echo "IS_STABLE=true" >> "$GITHUB_ENV"
5757
echo "Stable version detected"
5858
else

.github/workflows/github_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ on:
44
workflow_dispatch: # this is useful to re-generate the release page without a new tag being pushed
55
push:
66
tags:
7-
- "v2.[0-9]+.[0-9]+*"
7+
- "v[0-9]+.[0-9]+.[0-9]+*"
88
# Ignore release versions tagged with -rc0 suffix
9-
- "!v2.[0-9]+.[0-9]-rc0"
9+
- "!v[0-9]+.[0-9]+.[0-9]-rc0"
1010

1111
permissions:
1212
contents: read

docs-website/docusaurus.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
7979
beforeDefaultRemarkPlugins: [require('./src/remark/versionedReferenceLinks')],
8080
versions: {
8181
current: {
82-
label: '2.32-unstable',
82+
label: '3.0-unstable',
8383
path: 'next',
8484
banner: 'unreleased',
8585
},
@@ -132,7 +132,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
132132
exclude: ['**/_templates/**'],
133133
versions: {
134134
current: {
135-
label: '2.32-unstable',
135+
label: '3.0-unstable',
136136
path: 'next',
137137
banner: 'unreleased',
138138
},

0 commit comments

Comments
 (0)