From 95e428cdadae24ac401c8ea466f4242ef4c5ede5 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 10:44:33 +0000 Subject: [PATCH 1/8] Change website publication branch to "main" Change spdx-spec branch for the website publication to "main". Note that "main" is not exist yet. We have "master" and the content of "master" is not current (3.0.1). Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index ee4b57bdd9..156a9d9a45 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -10,7 +10,7 @@ jobs: build: runs-on: ubuntu-latest env: - REF_SPEC: "development/v3.0.1" # spec branch/tag release + REF_SPEC: "main" # spec branch/tag release REF_MODEL: "main" # model branch/tag release REF_PARSER: "main" # parser branch/tag release GH_PAGES_BRANCH: "gh-pages" # branch name to publish HTML to From 251379e9b33e458ebdc1e19634148e150e0ca0b7 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 10:46:05 +0000 Subject: [PATCH 2/8] Change the trigger branch name Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 156a9d9a45..7b32bb85ca 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -1,7 +1,7 @@ on: push: branches: - - development/v3.0.1 + - main repository_dispatch: types: - publish_v3_spec From 5d66dd91f5ba5a79e729f8cae000dad3a11dfe57 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 11:29:51 +0000 Subject: [PATCH 3/8] Add aliases of versions without "v" prefix Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 7b32bb85ca..63e59f34ad 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -16,7 +16,10 @@ jobs: GH_PAGES_BRANCH: "gh-pages" # branch name to publish HTML to VERSION: "v3.0.1" # publishing version VERSION_DEFAULT: "v3.0.1" # default version (be redirected from https://spdx.github.io/spdx-spec/) - VERSION_ALIASES: "latest v3.0 v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2" # aliases for VERSION + # VERSION_DEFAULT and VERSION can be different; + # for example, if VERSION_DEFAULT is a release candidate + VERSION_ALIASES: "latest 3.0.1 v3.0 v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2 3.0 3.0.1-draft 3-draft 3.0-RC1 3.0-RC2" + # VERSION_ALIASES are versions that will be redirected to VERSION; separated by space GIT_USER_NAME: "ci-bot" # for gh-pages commit GIT_USER_EMAIL: "ci-bot@spdx.dev" # for gh-pages commit PARSER_OUT_BASE_DIR: "__parser_out" # temp dir for output from spec-parser From 779b20d7aa21d3e1ab4542a17219cfc79619ee8d Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 12:03:04 +0000 Subject: [PATCH 4/8] Add notes on VERSION_DEFAULT and VERSION Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 63e59f34ad..eb7757c5ca 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -14,12 +14,14 @@ jobs: REF_MODEL: "main" # model branch/tag release REF_PARSER: "main" # parser branch/tag release GH_PAGES_BRANCH: "gh-pages" # branch name to publish HTML to - VERSION: "v3.0.1" # publishing version VERSION_DEFAULT: "v3.0.1" # default version (be redirected from https://spdx.github.io/spdx-spec/) + VERSION: "v3.0.1" # publishing version # VERSION_DEFAULT and VERSION can be different; - # for example, if VERSION_DEFAULT is a release candidate + # for example, if VERSION is a draft or a release candidate, + # or if VERSION is a stable version that is behind the default version (e.g. 3.0.2 vs 3.1) VERSION_ALIASES: "latest 3.0.1 v3.0 v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2 3.0 3.0.1-draft 3-draft 3.0-RC1 3.0-RC2" # VERSION_ALIASES are versions that will be redirected to VERSION; separated by space + # Note that the "latest" should be reserved for the latest version GIT_USER_NAME: "ci-bot" # for gh-pages commit GIT_USER_EMAIL: "ci-bot@spdx.dev" # for gh-pages commit PARSER_OUT_BASE_DIR: "__parser_out" # temp dir for output from spec-parser @@ -150,16 +152,20 @@ jobs: echo "====================" - name: Deploy and set aliases # mike is used here to manage multiple versions of MkDocs-powered documentation - # This step does 3 things: + # This step does 2 things: # 1) delete existing aliases (in VERSION_ALIASES), if exists # 2) deploy as VERSION, with aliases - # 3) set default version to VERSION_DEFAULT working-directory: spdx-spec run: | for alias in $VERSION_ALIASES; do mike delete --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push --allow-empty "$alias" || true done mike deploy --update-aliase --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push $VERSION $VERSION_ALIASES + - name: Set default version + # Set default version to VERSION_DEFAULT + # TODO: made some check to prevent branches/tags from "develop" to be set as default + working-directory: spdx-spec + run: | mike set-default --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push $VERSION_DEFAULT - name: Copy JSON annotations, JSON schema, JSON-LD context, and RDFs to alias directories # Fallback for backward compatibility with old URLs before v3.0.1 From cd1a000a465f56f806ee8f6c5e2aacb12ca69436 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 12:13:06 +0000 Subject: [PATCH 5/8] Add notes on VERSION_DEFAULT Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index eb7757c5ca..0c0ecf3e87 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -15,8 +15,9 @@ jobs: REF_PARSER: "main" # parser branch/tag release GH_PAGES_BRANCH: "gh-pages" # branch name to publish HTML to VERSION_DEFAULT: "v3.0.1" # default version (be redirected from https://spdx.github.io/spdx-spec/) - VERSION: "v3.0.1" # publishing version - # VERSION_DEFAULT and VERSION can be different; + # VERSION_DEFAULT should be the same across all branches/tags + VERSION: "v3.0.1" # publishing version, to be publish by this workflow + # VERSION can be different from VERSION_DEFAULT; # for example, if VERSION is a draft or a release candidate, # or if VERSION is a stable version that is behind the default version (e.g. 3.0.2 vs 3.1) VERSION_ALIASES: "latest 3.0.1 v3.0 v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2 3.0 3.0.1-draft 3-draft 3.0-RC1 3.0-RC2" @@ -204,7 +205,8 @@ jobs: # page (index.html) under a subdirectory with the name of 'from' # that will refresh the browser to a URL of 'to'. # - # For example, given + # For example, given: + # # VERSION = "v3.0.1" # VERSION_ALIASES = "latest v3.0" # from = "model/Core/Properties/imports" From ff4062ac4539cba403a8c42f56e29b0fe37b9dd6 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 13:13:53 +0000 Subject: [PATCH 6/8] Add header Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 0c0ecf3e87..6d1596db72 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -1,3 +1,14 @@ +# Publish SPDX specification to https://spdx.github.io/spdx-spec/ +# +# Overview: +# 1) Generate model documents and RDFs from model files in spdx-3-model repo +# 2) Combine the model documents from (1) with the chapters in spdx-spec repo +# 3) Generate a website using files from (2) +# 4) Upload RDFs from (1) and a website from (3) to GitHub Pages +# 5) Make URL redirections as needed +# +# See notes in https://github.com/spdx/spdx-spec/pull/1146 + on: push: branches: @@ -14,7 +25,8 @@ jobs: REF_MODEL: "main" # model branch/tag release REF_PARSER: "main" # parser branch/tag release GH_PAGES_BRANCH: "gh-pages" # branch name to publish HTML to - VERSION_DEFAULT: "v3.0.1" # default version (be redirected from https://spdx.github.io/spdx-spec/) + VERSION_DEFAULT: "v3.0.1" # default version; + # a version to be redirected from the URL without version number specified; # VERSION_DEFAULT should be the same across all branches/tags VERSION: "v3.0.1" # publishing version, to be publish by this workflow # VERSION can be different from VERSION_DEFAULT; From 1d41faefb958ff5f84f22a38021f558806a9bbdf Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 13:24:57 +0000 Subject: [PATCH 7/8] mike set-default only from main branch Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 6d1596db72..259df4c9f1 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -168,6 +168,8 @@ jobs: # This step does 2 things: # 1) delete existing aliases (in VERSION_ALIASES), if exists # 2) deploy as VERSION, with aliases + # If the existing aliases were redirected to other versions, + # it means this VERSION will "steal" the aliases from those versions. working-directory: spdx-spec run: | for alias in $VERSION_ALIASES; do @@ -176,7 +178,8 @@ jobs: mike deploy --update-aliase --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push $VERSION $VERSION_ALIASES - name: Set default version # Set default version to VERSION_DEFAULT - # TODO: made some check to prevent branches/tags from "develop" to be set as default + # Should only be done from the main branch + if: github.ref == 'refs/heads/main' working-directory: spdx-spec run: | mike set-default --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push $VERSION_DEFAULT From 89a565fc17c0a84f6447b09ffac640b1cf9e0da6 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 13:27:56 +0000 Subject: [PATCH 8/8] Add notes on set default version Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 259df4c9f1..8d7965f245 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -7,7 +7,8 @@ # 4) Upload RDFs from (1) and a website from (3) to GitHub Pages # 5) Make URL redirections as needed # -# See notes in https://github.com/spdx/spdx-spec/pull/1146 +# See notes on running this workflow from "support" branch at: +# https://github.com/spdx/spdx-spec/pull/1146 on: push: @@ -177,8 +178,9 @@ jobs: done mike deploy --update-aliase --config-file "$MKDOCS_FULL_YML" --branch $GH_PAGES_BRANCH --push $VERSION $VERSION_ALIASES - name: Set default version - # Set default version to VERSION_DEFAULT - # Should only be done from the main branch + # Set default version to VERSION_DEFAULT; + # if not set, the default version will remain the same. + # Should only be done from the "main" branch. if: github.ref == 'refs/heads/main' working-directory: spdx-spec run: |