Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CI for v3.0.1 publication #1100

Merged
merged 14 commits into from
Sep 6, 2024
Merged

CI for v3.0.1 publication #1100

merged 14 commits into from
Sep 6, 2024

Conversation

bact
Copy link
Collaborator

@bact bact commented Sep 2, 2024

Summary

Updated CI for v3.0.1 publication and new spec-parser directory structure

Will resolve #996, resolve #1018, resolve #1069

Removal of old workflows

This PR also remove .github/workflows/publish.yml and .github/workflows/publish_common.yml as they are no longer in use for v3 publication.

All of them are still available in v2 branches.
For example, https://github.com/spdx/spdx-spec/tree/development/v2.3/.github/workflows

Main workflow steps

Below are steps in .github/workflows/publish_v3.yml.
The big ones are the last two where they do extra work to keep old URLs working.
The YAML file has more comments.

  1. Checkout spdx-spec
  2. Checkout spdx-3-model
  3. Checkout spec-parser
  4. Install pre-requisites for spdx-spec
  5. Install pre-requisites for spec-parser
  6. Build model files
    • Using spec-parser
  7. Create directories for model (MkDocs) and RDF files
  8. Copy JSON annotations
  9. Copy JSON-LD context and RDFs
  10. Generate JSON schema
  11. Copy model files and file list for MkDocs
  12. Set Git identity
  13. Sync GitHub Pages
  14. Build complete MkDocs configuration
    • In this step, it combines model file list (mkdocs-files.yml, generated by spec-parser) with mkdocs.yml (it replaces "MODEL_PLACEHOLDER" string with the content of mkdocs-files.yml)
  15. Deploy and set aliases
  16. Copy JSON annotations, JSON schema, JSON-LD context, and RDFs to alias directories
  17. Make redirections (for renamed model elements and moved annexes)
    • This step make old names like imports to redirect to its new name at import.
    • It reads a list of redirect mapping from etc/redirect-map.csv;
      First value is 'from' (source), second value is 'to' (target).
    • 'from' and 'to' values will be inserted into the redirection HTML template etc/redirect-template.html
    • to create HTML files with 'from' name that will refresh the browser to the 'to'.

Demo

The demo of this workflow is at https://bact.github.io/spdx-spec/

To see what the workflow will look like when running, see a log at
https://github.com/bact/spdx-spec/actions/runs/10716224938
(this is deployed on my own personal repo, not the spdx one).

Redirection tests

To illustrates the redirection, here are some example.

@bact bact added the publishing label Sep 2, 2024
@bact bact added this to the 3.0.1 milestone Sep 2, 2024
@bact bact mentioned this pull request Sep 2, 2024
Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact
Copy link
Collaborator Author

bact commented Sep 3, 2024

@licquia here's the new CI for 3.0.1. Please kindly review. Thank you.

@bact bact added the ci Dev workflow and repo management label Sep 3, 2024
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
- Add back index.md since it is required as a home page, without it https://spdx.github.io/spdx-spec/v3.0.1/ will be 404 as there is no index.html generated
- Rename docs/front/index.md to docs/front/copyright.md

Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact
Copy link
Collaborator Author

bact commented Sep 3, 2024

Ping @zvr - I have to add index.md back at the docs root level here.

Because without it, URLs like https://spdx.github.io/spdx-spec/v3.0/ and https://spdx.github.io/spdx-spec/v3.0.1/ will return 404 File Not Found as there is no index.html being generated. MkDocs also use docs/index.md as an entry point.

Not sure if this will affect the ISO/OMG submissions or not, we will figure out, but in any case the index.md really has be at that exact location :(

UPDATE: it is now fixed by #1101

Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any issue - but it is a very large set of changes so some additional reviews would be helpful.

The redirects-map probably needs another set of eyes as well as the CI logic

Signed-off-by: Arthit Suriyawongkul <[email protected]>
@bact
Copy link
Collaborator Author

bact commented Sep 4, 2024

Thank you. It is really a huge changeset.

I just added comments explaining few steps more in the publish_v3.yml to facilitate the review.

- Add more comments and example to Redirection step
- Move make MkDocs config script to bin + add more comments/usage
- Revert newlines changes in submissions/ dir

Signed-off-by: Arthit Suriyawongkul <[email protected]>
- v3.0/introduction --> v3.0.1/front/introduction
- v3.0/normative-references --> v3.0.1/references
- v3.0/bibliography --> v3.0.1/references

Signed-off-by: Arthit Suriyawongkul <[email protected]>
@zvr
Copy link
Member

zvr commented Sep 6, 2024

I think this whole thing got too complicated and not easy to review.

I'll approve it and merge it and then we can incrementally fix issues (if there are any).

@zvr zvr merged commit c093dd9 into spdx:development/v3.0.1 Sep 6, 2024
2 checks passed
@bact bact deleted the new-ci-301 branch September 6, 2024 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci Dev workflow and repo management publishing
Projects
None yet
3 participants