Skip to content

Commit 47a5523

Browse files
Release artifacts for v0.0.8
Built from source commit 96cdb55
1 parent 5f3f997 commit 47a5523

File tree

23 files changed

+1268
-0
lines changed

23 files changed

+1268
-0
lines changed

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Microsoft Open Source Code of Conduct
2+
3+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
4+
5+
Resources:
6+
7+
- [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/)
8+
- [Microsoft Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/)
9+
- Contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with questions or concerns

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) Microsoft Corporation.
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE

README.md

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# ONNX Runtime GitHub Actions
2+
3+
This repository contains reusable GitHub Actions designed primarily for CI/CD pipelines within the ONNX Runtime organization's projects. It consolidates multiple actions into a single Node.js project to simplify maintenance and avoid checking compiled JavaScript code into consuming repositories.
4+
5+
This project uses `esbuild` to compile the JavaScript source code for each action. The compiled output is **not** committed to the `main` branch. Instead, releases are created based on Git tags, and the compiled actions are attached as downloadable assets to GitHub Releases.
6+
7+
## Project Structure
8+
9+
- `/src`: Contains the source TypeScript/JavaScript code for each action in its own subdirectory.
10+
- `/actions`: Contains the `action.yml` metadata file for each action in its own subdirectory.
11+
- `/build`: (Generated, not committed to `main`) Contains the compiled output after running `npm run build`. Each action has a subdirectory here containing its `action.yml` and `dist/index.js`.
12+
- `package.json`: Manages dependencies and build scripts for all actions.
13+
- `esbuild.config.mjs`: Configuration file for the `esbuild` bundler.
14+
15+
## Available Actions
16+
17+
1. **`build-docker-image`**
18+
19+
- Builds a Docker image, with optional caching and pushing via Azure Container Registry. This Action is Linux only.
20+
- See: [`actions/build-docker-image/action.yml`](./actions/build-docker-image/action.yml)
21+
- See details: [`.github/actions/build-docker-image/README.md`](./.github/actions/build-docker-image/README.md)
22+
23+
2. **`run-build-script-in-docker`**
24+
25+
- Runs the ONNX Runtime `tools/ci_build/build.py` script inside a specified Docker container. This Action is Linux only.
26+
- Supports different modes (`update`, `build`, `test`).
27+
- Includes auto-detection for NVIDIA GPUs (`--gpus all`).
28+
- Manages common volume mounts (workspace, cache, test data).
29+
- Handles enabling execution providers via `--use_<ep>` flags.
30+
- See: [`actions/run-build-script-in-docker/action.yml`](./actions/run-build-script-in-docker/action.yml)
31+
32+
3. **`setup-build-tools`**
33+
34+
- Sets up specified versions of CMake and vcpkg for build environments.
35+
- Downloads, verifies (via SHA512 hash), extracts, and caches the tools using `@actions/tool-cache`.
36+
- Runs CMake setup first, then vcpkg setup (including bootstrapping).
37+
- Optionally adds the installed CMake version to the system `PATH`.
38+
- Sets the `VCPKG_INSTALLATION_ROOT` environment variable for use with toolchain files.
39+
- Supports Windows, Linux, and macOS runners.
40+
- See: [`actions/setup-build-tools/action.yml`](./actions/setup-build-tools/action.yml)
41+
- See details: [`actions/setup-build-tools/README.md`](./actions/setup-build-tools/README.md)
42+
43+
## Usage (for Consumers)
44+
45+
Because the compiled action code (in the `build/` directory) is not present on the `main` branch or directly associated with version tags in the repository filesystem, you **cannot** use the actions directly like this:
46+
47+
```yaml
48+
# --- THIS WILL NOT WORK ---
49+
# uses: microsoft/onnxruntime-github-actions/build/run-build-script-in-docker@vX.Y.Z
50+
```
51+
52+
Instead, you must download the compiled action bundle from the corresponding GitHub Release asset and reference it locally:
53+
54+
1. Find the Release: Go to the Releases page of this repository.
55+
2. Identify Version: Find the release tag (e.g., v0.0.2) corresponding to the version you want to use.
56+
3. Download Asset: Download the .zip asset attached to that release (e.g., onnxruntime-actions-v0.0.2.zip).
57+
4. Use in Workflow: Add steps to your workflow to download and unzip the asset, then reference the action using its local path.
58+
59+
Example Workflow Snippet:
60+
61+
```yaml
62+
name: Example Workflow Using ORT Actions
63+
64+
on: [push]
65+
66+
jobs:
67+
build_with_ort_action:
68+
runs-on: ubuntu-latest
69+
steps:
70+
- name: Checkout Consumer Repo
71+
uses: actions/checkout@v4
72+
73+
# 1. Download the specific version of the action bundle
74+
- name: Download ORT Actions Asset (v0.0.2) # <-- Adjust version as needed
75+
uses: dsaltares/fetch-gh-release-asset@1.1.0 # Action to download assets
76+
with:
77+
repo: 'microsoft/onnxruntime-github-actions' # The repo containing the actions
78+
version: 'tags/v0.0.2' # The specific tag/version to use
79+
file: 'onnxruntime-actions-v0.0.2.zip' # The asset filename (matches release workflow output)
80+
target: 'onnxruntime-actions.zip' # Local filename to save as
81+
env:
82+
# Use default token for public repos, provide PAT for private if necessary
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
85+
# 2. Unzip the downloaded actions
86+
- name: Unzip ORT Actions
87+
run: |
88+
mkdir -p ./.github/_downloaded_actions # Create a directory to hold them
89+
unzip onnxruntime-actions.zip -d ./.github/_downloaded_actions
90+
echo "Unzipped contents:"
91+
ls -lR ./.github/_downloaded_actions # Verify structure
92+
93+
# 3. Use the action via its local path
94+
- name: Run Build Script in Docker
95+
# Reference the action.yml inside the unzipped structure
96+
uses: ./.github/_downloaded_actions/run-build-script-in-docker
97+
with:
98+
# Provide inputs for the action
99+
docker_image: 'your-build-image:latest'
100+
build_config: 'Release'
101+
mode: 'build' # Or 'update', 'test'
102+
execution_providers: 'cuda tensorrt'
103+
# ... other inputs ...
104+
```
105+
106+
# Integration Test
107+
108+
Before making a release, please use the following steps to do an integration test with ONNX Runtime's main repo. While the standard release process involves tags and downloadable assets (as described in the "Usage" section), we need to test changes in a consuming repository _before_ an official release is tagged, using the direct `uses:` syntax. This can be achieved by temporarily committing the compiled `build/` directory to a specific branch or commit.
109+
110+
**Note:** This method involves committing build artifacts to the Git repository, which is generally discouraged for the `main` branch as it increases repository size and complicates diffs. Use this approach primarily on short-lived development/feature branches for integration testing purposes.
111+
112+
**Steps that should be done in this repo:**
113+
114+
1. **Create a Branch:** Create a new development branch in _this_ repository (e.g., `dev/feature-xyz`).
115+
2. **Make Changes:** Modify the action source code (`src/`) and/or metadata (`actions/`).
116+
3. **Build:** Run `npm run build` from the repository root. This generates the output in the `build/` directory.
117+
4. **Commit Build Output:** Stage and commit **both** your source code changes AND the entire generated `build/` directory. You may need to bypass the `.gitignore` for the `build/` directory:
118+
```bash
119+
git add src/ actions/ # Stage source changes
120+
git add --force build/ # Force staging of the ignored build directory
121+
git commit -m "feat: Update action XYZ (including build output for testing)"
122+
```
123+
5. **Push Branch:** Push your development branch to the origin: `git push origin dev/feature-xyz`.
124+
6. **Get Commit SHA (Recommended):** After pushing, get the full commit SHA of your latest commit on the development branch (e.g., using `git rev-parse HEAD` or from the GitHub UI).
125+
126+
**Steps that should be done in the main ONNX Runtime repo**
127+
128+
1. Create a dev branch
129+
2. Modify the `uses:` line for the action you want to test to point to the specific branch or commit SHA in _this_ actions repository:
130+
131+
```yaml
132+
steps:
133+
- name: Run Pre-Release Build Script in Docker
134+
# Option 1: Using the branch name (updates automatically if branch changes)
135+
# uses: microsoft/onnxruntime-github-actions/build/run-build-script-in-docker@dev/feature-xyz
136+
137+
# Option 2: Using the specific commit SHA (safer - pins to exact version)
138+
uses: microsoft/onnxruntime-github-actions/build/run-build-script-in-docker@<full_commit_sha_from_actions_repo>
139+
with:
140+
# ... inputs ...
141+
```
142+
143+
_(Replace `<full_commit_sha_from_actions_repo>` with the actual SHA obtained in step 6 above)._
144+
145+
## Contributing
146+
147+
This project welcomes contributions and suggestions. Most contributions require you to agree to a
148+
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
149+
the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
150+
151+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide
152+
a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions
153+
provided by the bot. You will only need to do this once across all repos using our CLA.
154+
155+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).
156+
For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
157+
contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
158+
159+
## Trademarks
160+
161+
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft
162+
trademarks or logos is subject to and must follow
163+
[Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).
164+
Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.
165+
Any use of third-party trademarks or logos are subject to those third-party's policies.

SECURITY.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.9 BLOCK -->
2+
3+
## Security
4+
5+
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet) and [Xamarin](https://github.com/xamarin).
6+
7+
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/security.md/definition), please report it to us as described below.
8+
9+
## Reporting Security Issues
10+
11+
**Please do not report security vulnerabilities through public GitHub issues.**
12+
13+
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/security.md/msrc/create-report).
14+
15+
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/security.md/msrc/pgp).
16+
17+
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://www.microsoft.com/msrc).
18+
19+
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
20+
21+
- Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
22+
- Full paths of source file(s) related to the manifestation of the issue
23+
- The location of the affected source code (tag/branch/commit or direct URL)
24+
- Any special configuration required to reproduce the issue
25+
- Step-by-step instructions to reproduce the issue
26+
- Proof-of-concept or exploit code (if possible)
27+
- Impact of the issue, including how an attacker might exploit the issue
28+
29+
This information will help us triage your report more quickly.
30+
31+
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/security.md/msrc/bounty) page for more details about our active programs.
32+
33+
## Preferred Languages
34+
35+
We prefer all communications to be in English.
36+
37+
## Policy
38+
39+
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/security.md/cvd).
40+
41+
<!-- END MICROSOFT SECURITY.MD BLOCK -->

SUPPORT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support
2+
3+
This repo is for supporting ONNX Runtime's engineering system. If you'd like to use it in another places, everything is provided as is.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
name: 'Build Full ORT and Prepare Test Files'
2+
description: 'Installs requirements, builds full ORT wheel, installs it, and generates ORT format models and config files for minimal build tests in $RUNNER_TEMP.'
3+
runs:
4+
using: 'node20'
5+
main: 'dist/index.js'

0 commit comments

Comments
 (0)