From 95e428cdadae24ac401c8ea466f4242ef4c5ede5 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Wed, 13 Nov 2024 10:44:33 +0000 Subject: [PATCH 01/16] 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 02/16] 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 03/16] 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 04/16] 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 05/16] 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 06/16] 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 07/16] 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 08/16] 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: | From 20d9ba4b1219fb09a985afa9b225b668bf675e18 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Sun, 17 Nov 2024 15:57:19 +0000 Subject: [PATCH 09/16] Add more comments about variables Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 49 +++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 4f0313f339..85d8f72f4e 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -22,30 +22,33 @@ jobs: build: runs-on: ubuntu-latest env: - 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 - 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; - # 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) + REF_SPEC: "main" # spdx-spec branch: "main" or "develop" + REF_MODEL: "main" # spdx-3-model branch: "main" or "develop" + REF_PARSER: "main" # spec-parser branch/tag release + GH_PAGES_BRANCH: "gh-pages" # spdx-spec branch to publish HTML to + VERSION_DEFAULT: "v3.0.1" # Default version: + # - A version to be redirected to from the URL without version number specified + # - Should be a latest stable version from "main" branch + # - VERSION_DEFAULT should be the same in this workflow 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/release candidate, or + # if VERSION is a stable version that is behind the default version (e.g. 3.0.2 vs 3.1) + # - VERSION from "develop" branch should have "-draft" or "-RC" suffix 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 - PARSER_OUT_RDF_DIR: "rdf" # contains RDFs and schema; relative to PARSER_OUT_BASE_DIR - PARSER_OUT_MKDOCS_DIR: "mkdocs" # contains model Markdown files; relative to PARSER_OUT_BASE_DIR - MKDOCS_MODEL_YML: "model-files.yml" # contains list of model Markdown files - MKDOCS_BASE_YML: "mkdocs.yml" # initial MkDocs configuration - MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list - REDIRECT_MAP_PATH: "etc/redirect-map.csv" # redirect map - REDIRECT_TEMPLATE_PATH: "etc/redirect-template.html" # redirect HTML template + # VERSION_ALIASES are names that will be redirected to VERSION + # - Can be empty, can be multiple; separated by space + # - "latest" should be reserved for the latest version + GIT_USER_NAME: "ci-bot" # Username for gh-pages commit + GIT_USER_EMAIL: "ci-bot@spdx.dev" # E-mail for gh-pages commit + PARSER_OUT_BASE_DIR: "__parser_out" # Temporary dir for output from spec-parser + PARSER_OUT_RDF_DIR: "rdf" # Contains RDFs and schema; relative to PARSER_OUT_BASE_DIR + PARSER_OUT_MKDOCS_DIR: "mkdocs" # Contains model Markdown files; relative to PARSER_OUT_BASE_DIR + MKDOCS_MODEL_YML: "model-files.yml" # Contains list of model Markdown files; relative to PARSER_OUT_BASE_DIR + MKDOCS_BASE_YML: "mkdocs.yml" # Initial MkDocs configuration; from spdx-spec repo + MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list; to be generated + REDIRECT_MAP_PATH: "etc/redirect-map.csv" # URL redirect map + REDIRECT_TEMPLATE_PATH: "etc/redirect-template.html" # URL redirect HTML template steps: - name: Checkout spdx-spec uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 From b7f59439bf19e6e6981f1298dee5199968589e4b Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Mon, 18 Nov 2024 15:02:07 +0000 Subject: [PATCH 10/16] Update notes on main vs develop Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 34 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 85d8f72f4e..f078f3c15f 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -1,19 +1,30 @@ # Publish SPDX specification to https://spdx.github.io/spdx-spec/ # -# Overview: +# There will be this workflow in "main" branch and in "develop" branch. +# Each of them publish to a different URL. +# +# For example, +# this workflow in "main" can publish to https://spdx.github.io/spdx-spec/3.0.1/, +# while this workflow in "develop" can publish to https://spdx.github.io/spdx-spec/3.1-dev/. +# +# The workflow should be configured to have an URL without a version number +# specified be redirected to an URL published from "main" branch. +# +# ## Workflow 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 on running this workflow from "support" branch at: +# See notes at: # https://github.com/spdx/spdx-spec/pull/1146 on: push: branches: - - main + - develop # This should match with REF_SPEC repository_dispatch: types: - publish_v3_spec @@ -22,20 +33,21 @@ jobs: build: runs-on: ubuntu-latest env: - REF_SPEC: "main" # spdx-spec branch: "main" or "develop" - REF_MODEL: "main" # spdx-3-model branch: "main" or "develop" + REF_SPEC: "develop" # spdx-spec branch: "main" or "develop" + REF_MODEL: "main" # spdx-3-model branch: "main" or "develop" (now we only have "main") REF_PARSER: "main" # spec-parser branch/tag release GH_PAGES_BRANCH: "gh-pages" # spdx-spec branch to publish HTML to - VERSION_DEFAULT: "v3.0.1" # Default version: + VERSION_DEFAULT: "v3.0.1-draft" # Default version: # - A version to be redirected to from the URL without version number specified # - Should be a latest stable version from "main" branch # - VERSION_DEFAULT should be the same in this workflow across all branches/tags - VERSION: "v3.0.1" # Publishing version, to be publish by this workflow: + VERSION: "v3.0.1-draft" # Publishing version, to be publish by this workflow: # - VERSION can be different from VERSION_DEFAULT; - # for example, if VERSION is a draft/release candidate, or + # For example, if VERSION is a draft/release candidate, or # if VERSION is a stable version that is behind the default version (e.g. 3.0.2 vs 3.1) - # - VERSION from "develop" branch should have "-draft" or "-RC" suffix - 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 from "develop" branch should be indicated with a suffix ("-draft", "-RC", "-dev", etc.) + # 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 for a version from "main" branch when we released 3.0.1 + VERSION_ALIASES: "3.0.1 3.0.1-draft" # Version aliases for a version from "develop" branch when 3.0.1 is not yet released # VERSION_ALIASES are names that will be redirected to VERSION # - Can be empty, can be multiple; separated by space # - "latest" should be reserved for the latest version @@ -46,7 +58,7 @@ jobs: PARSER_OUT_MKDOCS_DIR: "mkdocs" # Contains model Markdown files; relative to PARSER_OUT_BASE_DIR MKDOCS_MODEL_YML: "model-files.yml" # Contains list of model Markdown files; relative to PARSER_OUT_BASE_DIR MKDOCS_BASE_YML: "mkdocs.yml" # Initial MkDocs configuration; from spdx-spec repo - MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list; to be generated + MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list; to be generated from MKDOCS_BASE_YML and MKDOCS_MODEL_YML REDIRECT_MAP_PATH: "etc/redirect-map.csv" # URL redirect map REDIRECT_TEMPLATE_PATH: "etc/redirect-template.html" # URL redirect HTML template steps: From 26e6ad5097c39e1738650e6b2a179d06cd550528 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Mon, 18 Nov 2024 17:32:09 +0000 Subject: [PATCH 11/16] Add info about "support/x.y" branch and RC Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 54 ++++++++++++++++++++++---------- 1 file changed, 37 insertions(+), 17 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index f078f3c15f..e4b87117b0 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -1,11 +1,12 @@ # Publish SPDX specification to https://spdx.github.io/spdx-spec/ # -# There will be this workflow in "main" branch and in "develop" branch. +# There will be this workflow in "main", "develop", and "support" branches. # Each of them publish to a different URL. # # For example, -# this workflow in "main" can publish to https://spdx.github.io/spdx-spec/3.0.1/, -# while this workflow in "develop" can publish to https://spdx.github.io/spdx-spec/3.1-dev/. +# the workflow in "main" may publish to https://spdx.github.io/spdx-spec/3.0.1/, +# the workflow in "develop" may publish to https://spdx.github.io/spdx-spec/3.1-dev/, +# the workflow in "support/3.0" may publish to https://spdx.github.io/spdx-spec/3.0.0/. # # The workflow should be configured to have an URL without a version number # specified be redirected to an URL published from "main" branch. @@ -20,6 +21,8 @@ # # See notes at: # https://github.com/spdx/spdx-spec/pull/1146 +# See branch structure at: +# ./README.md#branch-structure on: push: @@ -33,20 +36,34 @@ jobs: build: runs-on: ubuntu-latest env: - REF_SPEC: "develop" # spdx-spec branch: "main" or "develop" - REF_MODEL: "main" # spdx-3-model branch: "main" or "develop" (now we only have "main") - REF_PARSER: "main" # spec-parser branch/tag release + REF_SPEC: "develop" # spdx-spec branch: "main" or "develop" or "support/x.y" + REF_MODEL: "main" # spdx-3-model branch: "main" or "develop" or "support/x.y" + REF_PARSER: "main" # spdx-3-model branch: "main" or "develop" or "support/x.y" + # (now we have only "main" for spdx-3-model and spec-parser) GH_PAGES_BRANCH: "gh-pages" # spdx-spec branch to publish HTML to - VERSION_DEFAULT: "v3.0.1-draft" # Default version: - # - A version to be redirected to from the URL without version number specified + VERSION_DEFAULT: "v3.0.1-dev" # Default version: + # - A version to be redirected to from the URL without + # a version number specified # - Should be a latest stable version from "main" branch - # - VERSION_DEFAULT should be the same in this workflow across all branches/tags - VERSION: "v3.0.1-draft" # Publishing version, to be publish by this workflow: + # - VERSION_DEFAULT should be the same in this workflow + # across all branches/tags + VERSION: "v3.0.1-dev" # Publishing version, to be publish by this workflow: # - VERSION can be different from VERSION_DEFAULT; - # For example, if VERSION is a draft/release candidate, or - # if VERSION is a stable version that is behind the default version (e.g. 3.0.2 vs 3.1) - # - VERSION from "develop" branch should be indicated with a suffix ("-draft", "-RC", "-dev", etc.) - # 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 for a version from "main" branch when we released 3.0.1 + # For example, if VERSION is a draft/release candidate, + # or if VERSION is a stable version that is behind the + # default version (e.g. 3.0.2 vs 3.1) + # - VERSION from "develop" branch should be indicated with + # a suffix ("-dev", "-draft", etc.). + # The content of this version will constantly change. + # - A release candidate (with suffix "-RC") may be published + # from a very short-lived "support" branch. + # The content of this version should be kept unchanged, + # so it can be properly referenced during the review period, + # but the URL of the RC version may subjected to be + # redirected to the release version later. + # For example, v3.0-RC1 was redirected to v3.0 and + # will be redirected to 3.0.1 later. + # VERSION_ALIASES: "latest 3.0.1 v3.0 v3.0.1-dev v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2 3.0 3.0.1-dev 3.0.1-draft 3-draft 3.0-RC1 3.0-RC2" # Version aliases for a version from "main" branch when we released 3.0.1 VERSION_ALIASES: "3.0.1 3.0.1-draft" # Version aliases for a version from "develop" branch when 3.0.1 is not yet released # VERSION_ALIASES are names that will be redirected to VERSION # - Can be empty, can be multiple; separated by space @@ -55,10 +72,13 @@ jobs: GIT_USER_EMAIL: "ci-bot@spdx.dev" # E-mail for gh-pages commit PARSER_OUT_BASE_DIR: "__parser_out" # Temporary dir for output from spec-parser PARSER_OUT_RDF_DIR: "rdf" # Contains RDFs and schema; relative to PARSER_OUT_BASE_DIR - PARSER_OUT_MKDOCS_DIR: "mkdocs" # Contains model Markdown files; relative to PARSER_OUT_BASE_DIR - MKDOCS_MODEL_YML: "model-files.yml" # Contains list of model Markdown files; relative to PARSER_OUT_BASE_DIR + PARSER_OUT_MKDOCS_DIR: "mkdocs" # Contains model Markdown files: + # - relative to PARSER_OUT_BASE_DIR + MKDOCS_MODEL_YML: "model-files.yml" # Contains list of model Markdown files: + # - relative to PARSER_OUT_BASE_DIR MKDOCS_BASE_YML: "mkdocs.yml" # Initial MkDocs configuration; from spdx-spec repo - MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list; to be generated from MKDOCS_BASE_YML and MKDOCS_MODEL_YML + MKDOCS_FULL_YML: "__mkdocs-full.yml" # MkDocs configuration combined with model list: + # - to be generated from MKDOCS_BASE_YML and MKDOCS_MODEL_YML REDIRECT_MAP_PATH: "etc/redirect-map.csv" # URL redirect map REDIRECT_TEMPLATE_PATH: "etc/redirect-template.html" # URL redirect HTML template steps: From c24bb6417d243cd14f6fac1467cf02b3c92f1fd5 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Sat, 23 Nov 2024 20:02:56 +0000 Subject: [PATCH 12/16] Add notes on source branch and target URL mapping Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index e4b87117b0..42f5f9df13 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -20,9 +20,10 @@ # 5) Make URL redirections as needed # # See notes at: +# https://github.com/spdx/spdx-spec/issues/1155 # https://github.com/spdx/spdx-spec/pull/1146 # See branch structure at: -# ./README.md#branch-structure +# https://github.com/spdx/spdx-spec/blob/develop/README.md#branch-structure on: push: @@ -225,8 +226,8 @@ jobs: # This step creates copies of annotations/schema/RDFs to all alias # directories, so they can be accessible from all old URLs. # For example, - # - https://spdx.github.io/spdx-spec/v3.0/model/schema.json - # - https://spdx.github.io/spdx-spec/v3.0.1/rdf/schema.json + # - https://spdx.github.io/spdx-spec/v3.0/model/schema.json (old directory structure) + # - https://spdx.github.io/spdx-spec/v3.0.1/rdf/schema.json (new directory structure) # will all accessible and have the same content. # Unlike HTML files, these files have to be a copy, # since it cannot use the HTML refresh mechanism. @@ -249,11 +250,11 @@ jobs: # https://github.com/spdx/spdx-3-model/blob/main/CHANGELOG.md # # This step creates a HTML files to facilitate additional directions. - # It reads a redirect map from etc/redirect-map.csv; in the CSV, + # It reads a redirect map from /etc/redirect-map.csv; in the CSV, # first value is 'from' (source) and second value is 'to' (target). # # The 'from' and 'to' values will be inserted into a HTML template at - # from etc/redirect-template.html, to create a redirect HTML + # from /etc/redirect-template.html, to create a redirect HTML # page (index.html) under a subdirectory with the name of 'from' # that will refresh the browser to a URL of 'to'. # From 38bad4eb535ab0a478f7f2b2cfd961ad9a54b457 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Fri, 29 Nov 2024 07:41:08 +0000 Subject: [PATCH 13/16] Add notes to match version with mkdocs.yml Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 42f5f9df13..d24e8218ca 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -42,12 +42,14 @@ jobs: REF_PARSER: "main" # spdx-3-model branch: "main" or "develop" or "support/x.y" # (now we have only "main" for spdx-3-model and spec-parser) GH_PAGES_BRANCH: "gh-pages" # spdx-spec branch to publish HTML to - VERSION_DEFAULT: "v3.0.1-dev" # Default version: + VERSION_DEFAULT: "v3.0" # Default version: # - A version to be redirected to from the URL without # a version number specified # - Should be a latest stable version from "main" branch # - VERSION_DEFAULT should be the same in this workflow # across all branches/tags + # - VERSION_DEFAULT should also match with the + # mike's canonical_version in mkdocs.yml VERSION: "v3.0.1-dev" # Publishing version, to be publish by this workflow: # - VERSION can be different from VERSION_DEFAULT; # For example, if VERSION is a draft/release candidate, @@ -56,6 +58,9 @@ jobs: # - VERSION from "develop" branch should be indicated with # a suffix ("-dev", "-draft", etc.). # The content of this version will constantly change. + # - VERSION should also match with the version in the copyright + # text defined in mkdocs.yml + # e.g. "SPDX v3.x.x Copyright (c) 2010-2024, ..." # - A release candidate (with suffix "-RC") may be published # from a very short-lived "support" branch. # The content of this version should be kept unchanged, From be54fd7b67cd2f79f64e27f1ca265d315b280610 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Fri, 29 Nov 2024 08:46:47 +0000 Subject: [PATCH 14/16] Add versions without prefix 'v' Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 38 ++++++++++++++++++++++++++------ requirements.txt | 5 +---- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index d24e8218ca..23adf9f8e0 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -42,7 +42,7 @@ jobs: REF_PARSER: "main" # spdx-3-model branch: "main" or "develop" or "support/x.y" # (now we have only "main" for spdx-3-model and spec-parser) GH_PAGES_BRANCH: "gh-pages" # spdx-spec branch to publish HTML to - VERSION_DEFAULT: "v3.0" # Default version: + VERSION_DEFAULT: "v3.0.1" # Default version: # - A version to be redirected to from the URL without # a version number specified # - Should be a latest stable version from "main" branch @@ -50,15 +50,15 @@ jobs: # across all branches/tags # - VERSION_DEFAULT should also match with the # mike's canonical_version in mkdocs.yml - VERSION: "v3.0.1-dev" # Publishing version, to be publish by this workflow: + 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/release candidate, # or if VERSION is a stable version that is behind the - # default version (e.g. 3.0.2 vs 3.1) + # default version (e.g. v3.0.2 vs v3.1) # - VERSION from "develop" branch should be indicated with # a suffix ("-dev", "-draft", etc.). # The content of this version will constantly change. - # - VERSION should also match with the version in the copyright + # - VERSION should match with the version in the copyright # text defined in mkdocs.yml # e.g. "SPDX v3.x.x Copyright (c) 2010-2024, ..." # - A release candidate (with suffix "-RC") may be published @@ -68,12 +68,12 @@ jobs: # but the URL of the RC version may subjected to be # redirected to the release version later. # For example, v3.0-RC1 was redirected to v3.0 and - # will be redirected to 3.0.1 later. - # VERSION_ALIASES: "latest 3.0.1 v3.0 v3.0.1-dev v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2 3.0 3.0.1-dev 3.0.1-draft 3-draft 3.0-RC1 3.0-RC2" # Version aliases for a version from "main" branch when we released 3.0.1 - VERSION_ALIASES: "3.0.1 3.0.1-draft" # Version aliases for a version from "develop" branch when 3.0.1 is not yet released + # will be redirected to v3.0.1 later. + VERSION_ALIASES: "latest v3.0 v3.0.1-dev v3.0.1-draft v3-draft v3.0-RC1 v3.0-RC2" # VERSION_ALIASES are names that will be redirected to VERSION # - Can be empty, can be multiple; separated by space # - "latest" should be reserved for the latest version + # - Versions like "v3.0" will be expanded to "v3.0 3.0" GIT_USER_NAME: "ci-bot" # Username for gh-pages commit GIT_USER_EMAIL: "ci-bot@spdx.dev" # E-mail for gh-pages commit PARSER_OUT_BASE_DIR: "__parser_out" # Temporary dir for output from spec-parser @@ -88,6 +88,30 @@ jobs: REDIRECT_MAP_PATH: "etc/redirect-map.csv" # URL redirect map REDIRECT_TEMPLATE_PATH: "etc/redirect-template.html" # URL redirect HTML template steps: + - name: Expand version aliases to include a version without 'v' prefix + # VERSION: "v3.0.1" + # Original VERSION_ALIASES: "latest v3.0" + # Expanded VERSION_ALIASES: "3.0.1 latest v3.0 3.0" + run: | + echo VERSION: $VERSION + echo Original VERSION_ALIASES: $VERSION_ALIASES + original_aliases="$VERSION_ALIASES" + expanded_aliases="" + + if [[ $VERSION =~ ^v[0-9] ]]; then + expanded_aliases="$expanded_aliases ${VERSION#v}" + fi + + for version in $original_aliases; do + expanded_aliases="$expanded_aliases $version" + if [[ $version =~ ^v[0-9] ]]; then + expanded_aliases="$expanded_aliases ${version#v}" + fi + done + + expanded_aliases=$(echo $expanded_aliases | sed 's/^ *//g') + echo "VERSION_ALIASES=\"$expanded_aliases\"" >> $GITHUB_ENV + echo Expanded VERSION_ALIASES: $VERSION_ALIASES - name: Checkout spdx-spec uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 with: diff --git a/requirements.txt b/requirements.txt index 50d2eb069d..7945074f08 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,3 @@ -json-schema-for-humans==1.0.2 mike==2.1.3 mkdocs==1.6.1 -mkdocs-pdf-export-plugin==0.5.10 -PyYAML==6.0.2 -shacl2code==0.0.15 +# mkdocs-pdf-export-plugin==0.5.10 From 761ddd53f3161086cab9aa166014bdb39b5a5fc8 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Fri, 29 Nov 2024 09:00:58 +0000 Subject: [PATCH 15/16] Add notes on "on: push: branches" Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 23adf9f8e0..0c4988413e 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -28,7 +28,8 @@ on: push: branches: - - develop # This should match with REF_SPEC + - develop # This should match with REF_SPEC, + # to automatically publish from a correct branch repository_dispatch: types: - publish_v3_spec From 186c104da8db7e3766e0c0a35a301d79ac2e25b3 Mon Sep 17 00:00:00 2001 From: Arthit Suriyawongkul Date: Fri, 29 Nov 2024 09:17:57 +0000 Subject: [PATCH 16/16] Keep only necessary dependencies Signed-off-by: Arthit Suriyawongkul --- .github/workflows/publish_v3.yml | 4 +++- requirements.txt | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/publish_v3.yml b/.github/workflows/publish_v3.yml index 0c4988413e..1e1cd4dba5 100644 --- a/.github/workflows/publish_v3.yml +++ b/.github/workflows/publish_v3.yml @@ -111,7 +111,9 @@ jobs: done expanded_aliases=$(echo $expanded_aliases | sed 's/^ *//g') - echo "VERSION_ALIASES=\"$expanded_aliases\"" >> $GITHUB_ENV + echo "VERSION_ALIASES=$expanded_aliases" >> $GITHUB_ENV + - name: Check expanded version aliases + run: | echo Expanded VERSION_ALIASES: $VERSION_ALIASES - name: Checkout spdx-spec uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 diff --git a/requirements.txt b/requirements.txt index 7945074f08..73e3e08822 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ mike==2.1.3 mkdocs==1.6.1 # mkdocs-pdf-export-plugin==0.5.10 +PyYAML==6.0.2 +shacl2code==0.0.15