From 0851c80388d82dd7fe015ffcaaf8c2550e122cb5 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 11:45:31 +0100 Subject: [PATCH 01/10] :fireworks: Create initial `docs-action` --- .github/CODEOWNERS | 2 + .github/ISSUE_TEMPLATE.md | 26 ++++ .github/PULL_REQUEST_TEMPLATE.md | 21 ++++ .github/dependabot.yml | 9 ++ .github/workflows/ci.yml | 76 ++++++++++++ .github/workflows/release.yml | 35 ++++++ CODE_OF_CONDUCT.md | 88 ++++++++++++++ CONTRIBUTING.md | 91 ++++++++++++++ DEVELOPMENT.md | 53 ++++++++ LICENSE | 201 +++++++++++++++++++++++++++++++ README.md | 116 ++++++++++++++++++ changes/.keep | 0 changes/20260601114528.feature | 1 + publish/action.yml | 82 +++++++++++++ pyproject.toml | 87 +++++++++++++ validate/action.yml | 44 +++++++ version.properties | 5 + 17 files changed, 937 insertions(+) create mode 100644 .github/CODEOWNERS create mode 100644 .github/ISSUE_TEMPLATE.md create mode 100644 .github/PULL_REQUEST_TEMPLATE.md create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/release.yml create mode 100644 CODE_OF_CONDUCT.md create mode 100644 CONTRIBUTING.md create mode 100644 DEVELOPMENT.md create mode 100644 LICENSE create mode 100644 changes/.keep create mode 100644 changes/20260601114528.feature create mode 100644 publish/action.yml create mode 100644 pyproject.toml create mode 100644 validate/action.yml create mode 100644 version.properties diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..4e1b08f --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,2 @@ +# Default owners for everything in the repo. +* @Arm-Software/golang-utils-admin diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md new file mode 100644 index 0000000..b47e4ec --- /dev/null +++ b/.github/ISSUE_TEMPLATE.md @@ -0,0 +1,26 @@ + +### Description + + + + + +### Issue request type + + + +- [ ] Enhancement +- [ ] Bug +- [ ] Question diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 0000000..cf9ef2b --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,21 @@ + +### Description + + + + + +### Test Coverage + + + +- [ ] This change is covered by existing or additional automated tests. +- [ ] Manual testing has been performed (and evidence provided) as automated testing was not feasible. +- [ ] Additional tests are not required for this change (e.g. documentation update). diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e75a3c0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,9 @@ +version: 2 +updates: +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: daily + timezone: Europe/London + open-pull-requests-limit: 10 + rebase-strategy: disabled diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..4d52ecd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,76 @@ +# +# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +name: CI + +concurrency: + group: ${{ github.repository }}-${{ github.workflow }}-${{ inputs.branch || github.head_ref || github.ref }} + cancel-in-progress: true + +on: + push: + branches: [ main ] + tags-ignore: + - '**' + pull_request: + branches: [ main ] + +env: + python_version: '3.11' + +jobs: + assert-news: + name: Assert news files (See CONTRIBUTING.md) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.python_version }} + - uses: FranzDiebold/github-env-vars-action@v2 + - name: Install CI/CD tools + run: pip install continuous-delivery-scripts && pip list + - name: Assert news + run: cd-assert-news -b ${CI_ACTION_REF_NAME} + env: + GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Report failure if needed + if: ${{ failure() }} + run: | + echo "::error:: News file missing (See CONTRIBUTING.md guide for details)." + + arm-docs-package: + name: Check arm-docs package + runs-on: ubuntu-latest + steps: + - name: Install arm-docs package + run: | + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list + sudo apt-get update + sudo apt install -y arm-docs-github-action + sudo rm /etc/apt/sources.list.d/artifactory.list + sudo apt-get clean + + - name: Check arm-docs help + run: arm-docs --help + + - name: Check publish help + run: arm-docs publish --help + + - name: Check validate help + run: arm-docs validate --help + + action-files: + name: Check action files exist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check validate action metadata exists + run: test -f validate/action.yml + + - name: Check publish action metadata exists + run: test -f publish/action.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0e09fd9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,35 @@ +# +# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +name: GitHub Release + +env: + python_version: '3.11' + +on: + workflow_dispatch: + inputs: + release_type: + description: + "Enter type of release to perform (i.e. development, beta, release):" + required: true + +jobs: + release: + name: Carry out a release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + - uses: actions/setup-python@v6 + with: + python-version: ${{ env.python_version }} + - uses: FranzDiebold/github-env-vars-action@v2 + - name: Install CI/CD tools + run: pip install continuous-delivery-scripts>=2.7 && pip list + - name: Tag and release + run: cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ github.event.inputs.release_type }} -vv + env: + GIT_TOKEN: ${{ secrets.GIT_SECRET }} diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..910d227 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,88 @@ + +# Contributor Covenant Code of Conduct + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or + advances of any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email + address, without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at support@arm.com. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of actions. + +**Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the project community. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0, +available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. + +Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity). + +[homepage]: https://www.contributor-covenant.org + +For answers to common questions about this code of conduct, see the FAQ at +https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..040d13f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,91 @@ + +# Contribution Guide + +We really appreciate your contributions to the worklow. We are committed to +fostering a welcoming community, please see our Code of Conduct, which can be found here: + +- [Code of Conduct](./CODE_OF_CONDUCT.md) + +There are several ways to contribute: + +- Raise an issue found via this repository's GitHub Issues page. +- Open a pull request to: + - Provide a fix. + - Add an enhancement feature. + - Correct, update or add documentation. + + +## How to Contribute Documentation or Code + +Please keep contributions small and independent. We would much rather have multiple pull requests for each thing done +rather than have them all in the same one. This will help us review, give feedback and merge in the changes. The +normal process to make a change is as follows: + +1. Fork the repository. +2. Make your change and write unit tests, please try to match the existing documentation and coding style. +3. Add a news file describing the changes and add it in the `/changes` directory, see the section [News Files](#news_files) below. +4. Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). +5. Push to your fork. +6. Submit a pull request. + +We will review the proposed change as soon as we can and, if needed, give feedback. Please bear in mind that the framework +is complex and cover a large number of use cases. This means we may ask for changes not only to ensure +that the proposed change meets our quality criteria, but also to make sure the that the change is generally useful and +doesn't impact other uses cases or maintainability. + +### News Files + +News files serve a different purpose to commit messages, which are generally written to inform developers of the +project. News files will form part of the release notes so should be written to target the consumer of the GitHub action. + +- At least, one news file should be added for each Merge/Pull request to the directory `/changes`. +- The text of the file should be a single line describing the change and/or impact to the user. +- The filename of the news file should take the form `.`, e.g, `20191231.feature` where: + - The number is either the issue number or, if no issue exists, the date in the form `YYYYMMDDHHMM`. + - The extension should indicate the type of change as described in the following table: + +| Change Type | Extension | Version Impact | +|-------------------------------------------------------------------------------------------------------------------------|------------|-----------------| +| Backwards compatibility breakages or significant changes denoting a shift direction. | `.major` | Major increment | +| New features and enhancements (non breaking). | `.feature` | Minor increment | +| Bug fixes or corrections (non breaking). | `.bugfix` | Patch increment | +| Documentation impacting the consumer of the package (not repo documentation, such as this file, for this use `.misc`). | `.doc` | N/A | +| Deprecation of functionality or interfaces (not actual removal, for this use `.major`). | `.removal` | None | +| Changes to the repository that do not impact functionality e.g. build scripts change. | `.misc` | None | + +You can also use the [continuous delivery tools](https://github.com/ARMmbed/continuous-delivery-scripts) to generate those files. +```bash + pip install continuous-delivery-scripts + cd-create-news-file --type "" +``` + +## Merging the Pull Request + +When merging the pull request we will squash merge the changes, give it a title which provides context to +the changes: + +- ` (#)` + +An emoji is used to highlight what has occurred in the change. Commonly used emojis can be seen below, but for a full +list please see [Gitmoji](https://gitmoji.carloscuesta.me/): + +Emoji | Topic(s) +------|--------- +✨ | New features or enhancements. +🐛 | Bug / defect fixes. +🔒 | Fixing security issues. +⚡️ | Improving performance. +♻️ | Refactoring or addressing technical debt. +💥 | Breaking changes or removing functionality. +❗️ | Notice of deprecation. +📝 | Writing or updating documentation. +👷 | Adding to the CI or build system. +💚️ | Fixing CI or build system issues. +🚀 | Releasing or deploying. + +For more on the version number scheme please see the [ReadMe](./README.md). + +Thank you diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 0000000..43deea0 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,53 @@ + + +# Dependency upgrades + +For dependency upgrades, dependabot is relied upon and news files are auto-generated in order to document such change. + +# Releasing + +## Release Types + +The CI supports three release flows: + +- `development` for snapshot releases +- `release` for stable releases +- `beta` for pre-releases + + +| Type | Purpose | Version Number Format | GitHub Release | News Files Deleted | +|-------------|-------------|-----------------------|:--------------:|:------------------:| +| Release | General Availability | `..` | Yes | Yes | +| Beta | Integration Testing | `..-beta.` | Yes | No | +| Development | Development Testing | `..-dev+` | No | No | + +> :warning: releases can be made from any branches but +> it is recommended that they are only made from the `main` branch. + +### Release workflow + +1. Navigate to this repository's GitHub Actions page. +2. Select the **Run Workflow** button and type which kind of release you would like to make (i.e. release, beta or development). + +### Version Numbers + +The version number will be automatically calculated, based on the news files. + +# Detecting secrets + +So that no secrets are committed back to the repository, a combination of two tools are run in CI: +- [GitLeaks]() : Scans the git history for usual secrets (e.g. AWS keys, etc.) +- [detect-secrets](https://github.com/Yelp/detect-secrets): Scans only the current state of the repository for anything which can look like secrets (strings with high entropy) + +For the latter, False positive keys are stored in the [baseline](./.secrets.baseline) which `detect-secrets` checks against when it runs + +## Baseline & False positives + +To flag individual false positives add comment `# pragma: allowlist secret` to line with secret + +To add all suspected secrets in the repository (excluding ones with an allow secret comment), run `detect-secrets scan --all-files --exclude-files '.*go\.sum$' --exclude-files '.*\.html$' --exclude-files '.*\.properties$' --exclude-files 'ci.yml' --exclude-files '\.git' > .secrets.baseline` + +If on Windows: then change the encoding of the .secrets.baseline file to UTF-8 then convert all `\` to `/` in the .secrets.baseline file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index ea818df..1aab5e9 100644 --- a/README.md +++ b/README.md @@ -10,4 +10,120 @@ Each product team maintains its own documentation in its own repository and publ This GitHub action is the entry point for teams to publish their docs to a shared documentation portal under developer.arm.com in a way that is decentralised and easy to use. +Please [read the documentation to get started](https://docs.devplatform.arm.com/docs-action/getting-started/). +## Usage + +Validate a docs site: + +```yaml +- uses: ARM-Software/docs-action/validate@latest + with: + docs-root: docs + site-id: product-guides +``` + +Publish a docs site: + +```yaml +- name: AWS GitHub OIDC Login + uses: aws-actions/configure-aws-credentials@v4 + with: + role-to-assume: arn:aws:iam:::role/ + aws-region: eu-west-1 + +- uses: ARM-Software/docs-action/publish@latest + with: + docs-root: docs + site-id: product-guides + environment: staging +``` + +## Getting Started + +`arm-docs` expects a docs root containing Markdown or MDX content, plus optional `static/` assets and a `docs-config.json` file for site-level navigation and labelling. + +When you publish: + +- `site-id` becomes the route for your docs +- the published site ends up at `//` +- the Terraform `paths` value should match `site-id` + +### Add the Terraform access + +Your GitHub workflow needs an AWS role that is allowed to upload only your docs route. + +Add a module like this in the Terraform repository that manages the docs platform: + +```hcl +module "product_guides_upload_role" { + source = "../../../modules/reusable/docs-s3-upload-role" + + github_repository = "your-org/your-docs-repo" + bucket_name = module.ai_docs.bucket_name + paths = ["product-guides"] + + additional_policy_arns = [ + module.ai_docs.cloudfront_cache_invalidation_role_arn, + ] +} +``` + +What each field does: + +- `github_repository`: the only repository allowed to assume the role +- `bucket_name`: the S3 bucket that stores published sites +- `paths`: the docs routes this repository may publish to; this should usually contain exactly one value, and it should match `site-id`. These are the only paths this role will have access to publish +- `additional_policy_arns`: optional extra permissions, such as CloudFront invalidation + +If you publish to both staging and production, add the equivalent module in both environments and apply Terraform in both places. + +The `role-to-assume` value in your publish workflow should be the AWS role ARN created by this Terraform. + +Terraform is managed in `https://github.com/Arm-Debug/edge-ai-infra-terraform`. + +Relevant PR: `https://github.com/Arm-Debug/edge-ai-infra-terraform/pull/176` + +For the focused Terraform walkthrough, see `https://docs.devplatform.arm.com/docs-action/deployment/terraform-access/`. + +### Prepare the repository layout + +This is a simple repository layout when the docs root lives in `docs/`: + +```text +your-docs-repo/ +├── .github/ +│ └── workflows/ +│ ├── validate-docs.yml +│ └── publish-docs.yml +└── docs/ + ├── index.md + ├── getting-started/ + │ └── install.md + ├── reference/ + │ └── cli.md + ├── static/ + │ └── img/ + │ └── architecture.png + └── docs-config.json +``` + +The important rules are: + +- point `docs-root` at the docs root itself, not at the whole repository unless the docs live at repository root +- place Markdown or MDX files directly in the docs root or its subdirectories +- use `static/` for assets that should be copied into the built site as-is +- include `docs-config.json` to define the site label and top-level navigation for the docs site + +If your repository is docs-only, `docs-root` can be `.` instead of `docs`. + +## Validate Inputs + +- `docs-root`: Docs root inside the repository. +- `site-id`: Explicit site ID for the docs site. + +## Publish Inputs + +- `docs-root`: Docs root inside the repository. +- `site-id`: Explicit site ID for the docs site. +- `environment`: Deployment environment. Accepted values are `staging` and `production`. diff --git a/changes/.keep b/changes/.keep new file mode 100644 index 0000000..e69de29 diff --git a/changes/20260601114528.feature b/changes/20260601114528.feature new file mode 100644 index 0000000..662f6cc --- /dev/null +++ b/changes/20260601114528.feature @@ -0,0 +1 @@ +:fireworks: Create initial `docs-action` diff --git a/publish/action.yml b/publish/action.yml new file mode 100644 index 0000000..e5571a8 --- /dev/null +++ b/publish/action.yml @@ -0,0 +1,82 @@ +# +# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +name: docs-action-publish +description: GitHub Action for publishing Arm documentation sites +inputs: + docs-root: + description: Docs root inside the repository. Markdown content lives directly + under this directory; static/ and docs-config.json are treated specially. + required: true + site-id: + description: Explicit site ID for the docs site. + required: true + environment: + description: Deployment environment. Accepted values are `staging` and `production`. + required: true +runs: + using: composite + steps: + - name: Set up Node + uses: actions/setup-node@v6.4.0 + with: + node-version: 24 + + - name: Install arm-docs + shell: bash + run: | + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list + sudo apt-get update + sudo apt install -y arm-docs-github-action + sudo rm /etc/apt/sources.list.d/artifactory.list + sudo apt-get clean + + - name: Run arm-docs publish + shell: bash + env: + INPUT_DOCS_ROOT: ${{ inputs.docs-root }} + INPUT_SITE_ID: ${{ inputs.site-id }} + INPUT_ENVIRONMENT: ${{ inputs.environment }} + run: | + case "$INPUT_ENVIRONMENT" in + staging) + aws_region="eu-west-1" + site_url="https://docs.staging.devplatform.arm.com" + s3_bucket="arm-edge-ai-docs-staging-529607359382" + cloudfront_distribution_id="E3668SHWG5R3NX" + analytics_url="" # No need for analytics in the staging environment + ;; + + production) + aws_region="eu-west-1" + site_url="https://docs.devplatform.arm.com" + s3_bucket="arm-edge-ai-docs-prod-930800959236" + cloudfront_distribution_id="EA346A6MHUY68" + analytics_url="https://assets.adobedtm.com/268f09c22e73/c3400da3baca/launch-d08a7f55e4e4.min.js" + ;; + + *) + echo "::error::Unsupported environment '$INPUT_ENVIRONMENT'" + echo "::error::Expected one of: staging, production" + exit 1 + ;; + esac + + command=(arm-docs publish --docs-root "$INPUT_DOCS_ROOT") + + command+=(--site-id "$INPUT_SITE_ID") + command+=(--aws-region "$aws_region") + command+=(--site-url "$site_url") + command+=(--s3-bucket "$s3_bucket") + + command+=(--cloudfront-distribution-id "$cloudfront_distribution_id") + command+=(--cloudfront-invalidate=true) + + if [[ -n "$analytics_url" ]]; then + command+=(--analytics-url "$analytics_url") + fi + + echo "Running command: ${command[*]}" | tee -a "$GITHUB_STEP_SUMMARY" + + "${command[@]}" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..24b7067 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,87 @@ +# +# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +[ProjectConfig] +# Only path variables can and must contain 'DIR', 'PATH' or 'ROOT' in their name as +# these tokens are used to identify path variables from other variable types. +PROJECT_NAME = "GitHub Actions for validating and publishing Arm documentation sites" +PACKAGE_NAME = "arm-docs-github-action" +PROJECT_UUID = "d58edc9d-c2a6-4be4-9857-4ed3f84c683b" +PROJECT_ROOT = "." +NEWS_DIR = "changes/" +SOURCE_DIR = "action" +TAG_VERSION_SHORTCUTS = true +TAG_LATEST = true +RELEASE_BRANCH_PATTERN = "^v.*$" +MODULE_TO_DOCUMENT = "action" +DOCUMENTATION_DEFAULT_OUTPUT_PATH = "./docs" +DOCUMENTATION_PRODUCTION_OUTPUT_PATH = "./docs" +VERSION_FILE_PATH = "version.properties" +CHANGELOG_FILE_PATH = "CHANGELOG.md" +AWS_BUCKET="" +PROGRAMMING_LANGUAGE = "github_actions" +MASTER_BRANCH = "main" + +[AutoVersionConfig] +CONFIG_NAME = "JAVA" +PRERELEASE_TOKEN = "beta" +BUILD_TOKEN = "dev" +TAG_TEMPLATE = "{version}" +targets = [ "version.properties",] + +[AutoVersionConfig.key_aliases] +Version = "VERSION_KEY" +MajorVersion = "major" +MinorVersion = "minor" +PatchVersion = "patch" +CommitHash = "COMMIT" + +[AutoVersionConfig.trigger_patterns] +major = "changes/*.major" +minor = "changes/*.feature" +patch = "changes/*.bugfix" + +[tool.towncrier] +directory = "changes" +filename = "CHANGELOG.md" +package = "arm-docs-github-action" +title_format = "{version} ({project_date})" +start_string = """ +[//]: # (begin_release_notes) +""" + +[[tool.towncrier.type]] +directory = "major" +name = "Major changes" +showcontent = true + +[[tool.towncrier.type]] +directory = "feature" +name = "Features" +showcontent = true + +[[tool.towncrier.type]] +directory = "bugfix" +name = "Bugfixes" +showcontent = true + +[[tool.towncrier.type]] +directory = "doc" +name = "Improved Documentation" +showcontent = true + +[[tool.towncrier.type]] +directory = "removal" +name = "Deprecations and Removals" +showcontent = true + +[[tool.towncrier.type]] +directory = "misc" +name = "Misc" +showcontent = false + +[spdx] +CreatorWebsite = "spdx.org" +PathToSpdx = "spdx/spdxdocs" +UUID="e663d1c4-9365-43af-bd9b-c416cda71360" diff --git a/validate/action.yml b/validate/action.yml new file mode 100644 index 0000000..3d7a78c --- /dev/null +++ b/validate/action.yml @@ -0,0 +1,44 @@ +# +# Copyright (C) 2020-2026 Arm Limited or its affiliates and Contributors. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 +# +name: docs-action-validate +description: GitHub Action for validating Arm documentation sites +inputs: + docs-root: + description: Docs root inside the repository. Markdown content lives directly + under this directory; static/ and docs-config.json are treated specially. + required: true + site-id: + description: Explicit site ID for the docs site. + required: true +runs: + using: composite + steps: + - name: Set up Node + uses: actions/setup-node@v6.4.0 + with: + node-version: 24 + + - name: Install arm-docs + shell: bash + run: | + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list + sudo apt-get update + sudo apt install -y arm-docs-github-action + sudo rm /etc/apt/sources.list.d/artifactory.list + sudo apt-get clean + + - name: Run arm-docs validate + shell: bash + env: + INPUT_DOCS_ROOT: ${{ inputs.docs-root }} + INPUT_SITE_ID: ${{ inputs.site-id }} + run: | + command=(arm-docs validate --docs-root "$INPUT_DOCS_ROOT") + + command+=(--site-id "$INPUT_SITE_ID") + + echo "Running command: ${command[*]}" | tee -a "$GITHUB_STEP_SUMMARY" + + "${command[@]}" diff --git a/version.properties b/version.properties new file mode 100644 index 0000000..9cee01f --- /dev/null +++ b/version.properties @@ -0,0 +1,5 @@ +Version=0.0.0 +MajorVersion=0 +MinorVersion=0 +PatchVersion=0 +CommitHash= From 0ebcfd5d6b068d2355df11ffe5c53be3a8044386 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 11:55:29 +0100 Subject: [PATCH 02/10] use ARM_SOFTWARE_TOKEN for git token --- .github/workflows/ci.yml | 9 +++++---- .github/workflows/release.yml | 10 +++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d52ecd..29f9283 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,19 +5,20 @@ name: CI concurrency: - group: ${{ github.repository }}-${{ github.workflow }}-${{ inputs.branch || github.head_ref || github.ref }} + group: ${{ github.repository }}-${{ github.workflow }}-${{ inputs.branch || + github.head_ref || github.ref }} cancel-in-progress: true on: push: branches: [ main ] tags-ignore: - - '**' + - "**" pull_request: branches: [ main ] env: - python_version: '3.11' + python_version: "3.11" jobs: assert-news: @@ -36,7 +37,7 @@ jobs: - name: Assert news run: cd-assert-news -b ${CI_ACTION_REF_NAME} env: - GIT_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GIT_TOKEN: ${{ secrets.ARM_SOFTWARE_TOKEN }} - name: Report failure if needed if: ${{ failure() }} run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0e09fd9..0c27cd2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -5,14 +5,13 @@ name: GitHub Release env: - python_version: '3.11' + python_version: "3.11" on: workflow_dispatch: inputs: release_type: - description: - "Enter type of release to perform (i.e. development, beta, release):" + description: "Enter type of release to perform (i.e. development, beta, release):" required: true jobs: @@ -30,6 +29,7 @@ jobs: - name: Install CI/CD tools run: pip install continuous-delivery-scripts>=2.7 && pip list - name: Tag and release - run: cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ github.event.inputs.release_type }} -vv + run: cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ + github.event.inputs.release_type }} -vv env: - GIT_TOKEN: ${{ secrets.GIT_SECRET }} + GIT_TOKEN: ${{ secrets.ARM_SOFTWARE_TOKEN }} From 3d2c1c350237e7ee063c9557ad521bf94ca82213 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 16:25:22 +0100 Subject: [PATCH 03/10] CI changes for specifying version of underlying debian package (should fail) --- .github/workflows/ci.yml | 33 ++++++++++++++++++++++++++++++++- README.md | 5 +++++ changes/.keep | 0 publish/action.yml | 6 +++++- validate/action.yml | 6 +++++- 5 files changed, 47 insertions(+), 3 deletions(-) delete mode 100644 changes/.keep diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29f9283..8e69dae 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,6 +19,7 @@ on: env: python_version: "3.11" + arm_docs_package_version: "" jobs: assert-news: @@ -43,15 +44,45 @@ jobs: run: | echo "::error:: News file missing (See CONTRIBUTING.md guide for details)." + assert-package-version-pins: + name: Assert package version pins + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + + - name: Check pinned package version values are set + shell: bash + run: | + if ! grep -Eq '^[[:space:]]*ARM_DOCS_PACKAGE_VERSION: "[^"]+"$' publish/action.yml; then + echo "::error:: publish/action.yml must set ARM_DOCS_PACKAGE_VERSION to a specific package version." + exit 1 + fi + + if ! grep -Eq '^[[:space:]]*ARM_DOCS_PACKAGE_VERSION: "[^"]+"$' validate/action.yml; then + echo "::error:: validate/action.yml must set ARM_DOCS_PACKAGE_VERSION to a specific package version." + exit 1 + fi + + if ! grep -Eq '^[[:space:]]*arm_docs_package_version: "[^"]+"$' .github/workflows/ci.yml; then + echo "::error:: .github/workflows/ci.yml must set arm_docs_package_version to a specific package version." + exit 1 + fi + arm-docs-package: name: Check arm-docs package runs-on: ubuntu-latest + needs: + - assert-package-version-pins steps: - name: Install arm-docs package + env: + ARM_DOCS_PACKAGE_VERSION: ${{ env.arm_docs_package_version }} run: | + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list sudo apt-get update - sudo apt install -y arm-docs-github-action + sudo apt install -y "arm-docs-github-action=$ARM_DOCS_PACKAGE_VERSION" sudo rm /etc/apt/sources.list.d/artifactory.list sudo apt-get clean diff --git a/README.md b/README.md index 1aab5e9..1bfe9c1 100644 --- a/README.md +++ b/README.md @@ -127,3 +127,8 @@ If your repository is docs-only, `docs-root` can be `.` instead of `docs`. - `docs-root`: Docs root inside the repository. - `site-id`: Explicit site ID for the docs site. - `environment`: Deployment environment. Accepted values are `staging` and `production`. + +## Package Version + +- The installed Debian package version is controlled by maintainer-edited variables in `publish/action.yml`, `validate/action.yml`, and `.github/workflows/ci.yml`. +- CI checks that all of those pinned version values are set before the package install job runs. diff --git a/changes/.keep b/changes/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/publish/action.yml b/publish/action.yml index e5571a8..f2d5b8d 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -25,10 +25,14 @@ runs: - name: Install arm-docs shell: bash + env: + ARM_DOCS_PACKAGE_VERSION: "" run: | + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list sudo apt-get update - sudo apt install -y arm-docs-github-action + sudo apt install -y "arm-docs-github-action=$ARM_DOCS_PACKAGE_VERSION" sudo rm /etc/apt/sources.list.d/artifactory.list sudo apt-get clean diff --git a/validate/action.yml b/validate/action.yml index 3d7a78c..bfbe582 100644 --- a/validate/action.yml +++ b/validate/action.yml @@ -22,10 +22,14 @@ runs: - name: Install arm-docs shell: bash + env: + ARM_DOCS_PACKAGE_VERSION: "" run: | + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." + echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list sudo apt-get update - sudo apt install -y arm-docs-github-action + sudo apt install -y "arm-docs-github-action=$ARM_DOCS_PACKAGE_VERSION" sudo rm /etc/apt/sources.list.d/artifactory.list sudo apt-get clean From 266ceaab7412a8bd3d060cdfacaf6b1b8842fa51 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 16:27:58 +0100 Subject: [PATCH 04/10] add version --- .github/workflows/ci.yml | 2 +- publish/action.yml | 2 +- validate/action.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8e69dae..f020d34 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ on: env: python_version: "3.11" - arm_docs_package_version: "" + arm_docs_package_version: "0.4.1" jobs: assert-news: diff --git a/publish/action.yml b/publish/action.yml index f2d5b8d..6295384 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -26,7 +26,7 @@ runs: - name: Install arm-docs shell: bash env: - ARM_DOCS_PACKAGE_VERSION: "" + ARM_DOCS_PACKAGE_VERSION: "0.4.1" run: | echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." diff --git a/validate/action.yml b/validate/action.yml index bfbe582..e936bec 100644 --- a/validate/action.yml +++ b/validate/action.yml @@ -23,7 +23,7 @@ runs: - name: Install arm-docs shell: bash env: - ARM_DOCS_PACKAGE_VERSION: "" + ARM_DOCS_PACKAGE_VERSION: "0.4.1" run: | echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." From bd524fd1b8021a76dc220ccc21e78036e041f38c Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 16:39:25 +0100 Subject: [PATCH 05/10] add version file --- .github/workflows/ci.yml | 28 ++++++++++------------ README.md | 5 ++-- arm-docs-github-action-package-version.txt | 1 + publish/action.yml | 4 ++-- validate/action.yml | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 arm-docs-github-action-package-version.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f020d34..74540ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,6 @@ on: env: python_version: "3.11" - arm_docs_package_version: "0.4.1" jobs: assert-news: @@ -44,27 +43,24 @@ jobs: run: | echo "::error:: News file missing (See CONTRIBUTING.md guide for details)." - assert-package-version-pins: - name: Assert package version pins + assert-package-version-pin-file: + name: Assert package version pin file runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - name: Check pinned package version values are set + - name: Check underlying tool package version file is set shell: bash run: | - if ! grep -Eq '^[[:space:]]*ARM_DOCS_PACKAGE_VERSION: "[^"]+"$' publish/action.yml; then - echo "::error:: publish/action.yml must set ARM_DOCS_PACKAGE_VERSION to a specific package version." + if [[ ! -f arm-docs-github-action-package-version.txt ]]; then + echo "::error:: arm-docs-github-action-package-version.txt must exist." exit 1 fi - if ! grep -Eq '^[[:space:]]*ARM_DOCS_PACKAGE_VERSION: "[^"]+"$' validate/action.yml; then - echo "::error:: validate/action.yml must set ARM_DOCS_PACKAGE_VERSION to a specific package version." - exit 1 - fi + arm_docs_package_version="$(tr -d '[:space:]' < arm-docs-github-action-package-version.txt)" - if ! grep -Eq '^[[:space:]]*arm_docs_package_version: "[^"]+"$' .github/workflows/ci.yml; then - echo "::error:: .github/workflows/ci.yml must set arm_docs_package_version to a specific package version." + if [[ -z "$arm_docs_package_version" ]]; then + echo "::error:: arm-docs-github-action-package-version.txt must set a specific package version." exit 1 fi @@ -72,12 +68,14 @@ jobs: name: Check arm-docs package runs-on: ubuntu-latest needs: - - assert-package-version-pins + - assert-package-version-pin-file steps: + - uses: actions/checkout@v6 + - name: Install arm-docs package - env: - ARM_DOCS_PACKAGE_VERSION: ${{ env.arm_docs_package_version }} run: | + ARM_DOCS_PACKAGE_VERSION="$(tr -d '[:space:]' < arm-docs-github-action-package-version.txt)" + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list diff --git a/README.md b/README.md index 1bfe9c1..dd26368 100644 --- a/README.md +++ b/README.md @@ -130,5 +130,6 @@ If your repository is docs-only, `docs-root` can be `.` instead of `docs`. ## Package Version -- The installed Debian package version is controlled by maintainer-edited variables in `publish/action.yml`, `validate/action.yml`, and `.github/workflows/ci.yml`. -- CI checks that all of those pinned version values are set before the package install job runs. +- The installed Debian package version is controlled by `arm-docs-github-action-package-version.txt`. +- That file is intentionally named after the underlying Debian package so it is clearly distinct from this shim action's own version. +- CI checks that this underlying tool package version file is set before the package install job runs. diff --git a/arm-docs-github-action-package-version.txt b/arm-docs-github-action-package-version.txt new file mode 100644 index 0000000..267577d --- /dev/null +++ b/arm-docs-github-action-package-version.txt @@ -0,0 +1 @@ +0.4.1 diff --git a/publish/action.yml b/publish/action.yml index 6295384..7def4f7 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -25,9 +25,9 @@ runs: - name: Install arm-docs shell: bash - env: - ARM_DOCS_PACKAGE_VERSION: "0.4.1" run: | + ARM_DOCS_PACKAGE_VERSION="$(tr -d '[:space:]' < "$GITHUB_ACTION_PATH/../arm-docs-github-action-package-version.txt")" + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list diff --git a/validate/action.yml b/validate/action.yml index e936bec..810b9c8 100644 --- a/validate/action.yml +++ b/validate/action.yml @@ -22,9 +22,9 @@ runs: - name: Install arm-docs shell: bash - env: - ARM_DOCS_PACKAGE_VERSION: "0.4.1" run: | + ARM_DOCS_PACKAGE_VERSION="$(tr -d '[:space:]' < "$GITHUB_ACTION_PATH/../arm-docs-github-action-package-version.txt")" + echo "::notice::arm-docs-github-action version $ARM_DOCS_PACKAGE_VERSION." echo "deb [trusted=yes] https://artifacts.tools.arm.com/tools-deb bionic main" | sudo tee -a /etc/apt/sources.list.d/artifactory.list From 9ed867b46cbac6c699ccb94e285f438b90777d5a Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Mon, 1 Jun 2026 17:00:45 +0100 Subject: [PATCH 06/10] pyproject.toml --- pyproject.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 24b7067..096df11 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,8 +6,8 @@ # Only path variables can and must contain 'DIR', 'PATH' or 'ROOT' in their name as # these tokens are used to identify path variables from other variable types. PROJECT_NAME = "GitHub Actions for validating and publishing Arm documentation sites" -PACKAGE_NAME = "arm-docs-github-action" -PROJECT_UUID = "d58edc9d-c2a6-4be4-9857-4ed3f84c683b" +PACKAGE_NAME = "docs-action" +PROJECT_UUID = "276d98df-d74b-4c90-9bd3-8c3ba0baa362" PROJECT_ROOT = "." NEWS_DIR = "changes/" SOURCE_DIR = "action" @@ -22,6 +22,7 @@ CHANGELOG_FILE_PATH = "CHANGELOG.md" AWS_BUCKET="" PROGRAMMING_LANGUAGE = "github_actions" MASTER_BRANCH = "main" +COPYRIGHT_START_DATE = "2026" [AutoVersionConfig] CONFIG_NAME = "JAVA" @@ -84,4 +85,4 @@ showcontent = false [spdx] CreatorWebsite = "spdx.org" PathToSpdx = "spdx/spdxdocs" -UUID="e663d1c4-9365-43af-bd9b-c416cda71360" +UUID="7bceb192-2fa6-48ff-af4b-b9616ede23ce" From dfe5ae1ebf28e59fb69bf7b0c265f6d9b313b941 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Tue, 2 Jun 2026 15:20:09 +0100 Subject: [PATCH 07/10] pin versions --- .github/workflows/ci.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74540ca..2fa5a2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,7 +31,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: ${{ env.python_version }} - - uses: FranzDiebold/github-env-vars-action@v2 + - uses: FranzDiebold/github-env-vars-action@e8118971bd6b60524ae66a2d870bc83088e3a3c9 # v2.9.0 - name: Install CI/CD tools run: pip install continuous-delivery-scripts && pip list - name: Assert news diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0c27cd2..4338b0b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-python@v6 with: python-version: ${{ env.python_version }} - - uses: FranzDiebold/github-env-vars-action@v2 + - uses: FranzDiebold/github-env-vars-action@e8118971bd6b60524ae66a2d870bc83088e3a3c9 # v2.9.0 - name: Install CI/CD tools run: pip install continuous-delivery-scripts>=2.7 && pip list - name: Tag and release From 9aee0ea2764e94f60e4fa5faebd38ad810667a76 Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Tue, 2 Jun 2026 16:07:01 +0100 Subject: [PATCH 08/10] remove references to private topologies --- README.md | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/README.md b/README.md index dd26368..7f977d4 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,6 @@ Each product team maintains its own documentation in its own repository and publ This GitHub action is the entry point for teams to publish their docs to a shared documentation portal under developer.arm.com in a way that is decentralised and easy to use. -Please [read the documentation to get started](https://docs.devplatform.arm.com/docs-action/getting-started/). - ## Usage Validate a docs site: @@ -47,44 +45,6 @@ When you publish: - `site-id` becomes the route for your docs - the published site ends up at `//` -- the Terraform `paths` value should match `site-id` - -### Add the Terraform access - -Your GitHub workflow needs an AWS role that is allowed to upload only your docs route. - -Add a module like this in the Terraform repository that manages the docs platform: - -```hcl -module "product_guides_upload_role" { - source = "../../../modules/reusable/docs-s3-upload-role" - - github_repository = "your-org/your-docs-repo" - bucket_name = module.ai_docs.bucket_name - paths = ["product-guides"] - - additional_policy_arns = [ - module.ai_docs.cloudfront_cache_invalidation_role_arn, - ] -} -``` - -What each field does: - -- `github_repository`: the only repository allowed to assume the role -- `bucket_name`: the S3 bucket that stores published sites -- `paths`: the docs routes this repository may publish to; this should usually contain exactly one value, and it should match `site-id`. These are the only paths this role will have access to publish -- `additional_policy_arns`: optional extra permissions, such as CloudFront invalidation - -If you publish to both staging and production, add the equivalent module in both environments and apply Terraform in both places. - -The `role-to-assume` value in your publish workflow should be the AWS role ARN created by this Terraform. - -Terraform is managed in `https://github.com/Arm-Debug/edge-ai-infra-terraform`. - -Relevant PR: `https://github.com/Arm-Debug/edge-ai-infra-terraform/pull/176` - -For the focused Terraform walkthrough, see `https://docs.devplatform.arm.com/docs-action/deployment/terraform-access/`. ### Prepare the repository layout From ec104ff4dc98605b83eee9f3cc57f95fa07b2b4c Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Tue, 2 Jun 2026 17:10:14 +0100 Subject: [PATCH 09/10] review --- .github/workflows/release.yml | 7 ++++++- publish/action.yml | 4 ++++ validate/action.yml | 4 ++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4338b0b..7f083ff 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,6 +13,11 @@ on: release_type: description: "Enter type of release to perform (i.e. development, beta, release):" required: true + type: choice + options: + - development + - beta + - release jobs: release: @@ -27,7 +32,7 @@ jobs: python-version: ${{ env.python_version }} - uses: FranzDiebold/github-env-vars-action@e8118971bd6b60524ae66a2d870bc83088e3a3c9 # v2.9.0 - name: Install CI/CD tools - run: pip install continuous-delivery-scripts>=2.7 && pip list + run: pip install 'continuous-delivery-scripts==2.7' && pip list - name: Tag and release run: cd-tag-and-release -b ${CI_ACTION_REF_NAME} -t ${{ github.event.inputs.release_type }} -vv diff --git a/publish/action.yml b/publish/action.yml index 7def4f7..b6f386a 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -18,10 +18,14 @@ inputs: runs: using: composite steps: + - name: Set up pnpm + uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - name: Set up Node uses: actions/setup-node@v6.4.0 with: node-version: 24 + cache: pnpm - name: Install arm-docs shell: bash diff --git a/validate/action.yml b/validate/action.yml index 810b9c8..b8412b3 100644 --- a/validate/action.yml +++ b/validate/action.yml @@ -15,10 +15,14 @@ inputs: runs: using: composite steps: + - name: Set up pnpm + uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093 # v6.0.8 + - name: Set up Node uses: actions/setup-node@v6.4.0 with: node-version: 24 + cache: pnpm - name: Install arm-docs shell: bash From 14c783a44baea31b2b71fd91538d490968ab29ca Mon Sep 17 00:00:00 2001 From: joshjennings98 Date: Wed, 3 Jun 2026 10:31:06 +0100 Subject: [PATCH 10/10] qa analytics script --- publish/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/publish/action.yml b/publish/action.yml index b6f386a..b99e14c 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -53,7 +53,7 @@ runs: site_url="https://docs.staging.devplatform.arm.com" s3_bucket="arm-edge-ai-docs-staging-529607359382" cloudfront_distribution_id="E3668SHWG5R3NX" - analytics_url="" # No need for analytics in the staging environment + analytics_url="https://assets.adobedtm.com/268f09c22e73/c3400da3baca/launch-d106b1020c99-development.min.js" ;; production)