not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 1 | # Publishes a draft snapshot, after performing validation to make sure all linux |
| 2 | # packages are stable. |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 3 | name: Validate and Publish Release |
| 4 | |
| 5 | on: |
| 6 | workflow_dispatch: |
| 7 | inputs: |
| 8 | release_id: |
Geoffrey Martin-Noble | b22c931 | 2022-07-28 08:47:29 -0700 | [diff] [blame] | 9 | description: "Release id to publish" |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 10 | required: true |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 11 | package_version: |
Geoffrey Martin-Noble | b22c931 | 2022-07-28 08:47:29 -0700 | [diff] [blame] | 12 | description: "Version of the package" |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 13 | required: true |
| 14 | build_run_id: |
Geoffrey Martin-Noble | b22c931 | 2022-07-28 08:47:29 -0700 | [diff] [blame] | 15 | description: "Run ID for the build_package.yml workflow that triggered this workflow" |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 16 | required: true |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 17 | |
| 18 | jobs: |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 19 | validate_packages: |
| 20 | name: "Validate packages" |
| 21 | # TODO(jennik): Look into testing windows and macos builds. |
CindyLiu | b84d977 | 2022-10-24 13:38:32 -0700 | [diff] [blame] | 22 | runs-on: ubuntu-20.04 |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 23 | steps: |
| 24 | - name: Download packages |
| 25 | id: download_packages |
Geoffrey Martin-Noble | 492299c | 2023-03-30 09:12:03 -0700 | [diff] [blame] | 26 | uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0 |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 27 | with: |
Geoffrey Martin-Noble | f88dd96 | 2022-12-09 10:48:51 -0800 | [diff] [blame] | 28 | github_token: ${{secrets.WRITE_ACCESS_TOKEN}} |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 29 | workflow: build_package.yml |
| 30 | run_id: ${{ github.event.inputs.build_run_id }} |
| 31 | - name: Extract and display downloaded files |
| 32 | run: | |
Scott Todd | fc212da | 2024-06-27 09:59:54 -0700 | [diff] [blame] | 33 | tar -xf wheels-linux-x86_64-main-dist-linux/iree-dist-${{ github.event.inputs.package_version }}-linux-x86_64.tar.xz |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 34 | pwd |
| 35 | ls -R |
| 36 | - name: Set up python |
| 37 | id: set_up_python |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 38 | uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0 |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 39 | with: |
Han-Chung Wang | 9ed3dab | 2023-08-30 14:25:24 -0700 | [diff] [blame] | 40 | python-version: "3.9" |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 41 | - name: Install python packages |
| 42 | id: install_python_packages |
| 43 | run: | |
Scott Todd | fc212da | 2024-06-27 09:59:54 -0700 | [diff] [blame] | 44 | python -m pip install -f file://$PWD/wheels-linux-x86_64-py-compiler-pkg/ iree-compiler[onnx] |
| 45 | python -m pip install -f file://$PWD/wheels-linux-x86_64-py-runtime-pkg/ iree-runtime |
| 46 | python -m pip install -f file://$PWD/wheels-linux-x86_64-py-tf-compiler-tools-pkg/ iree-tools-tflite iree-tools-tf |
Stella Laurenzo | 7b7ffeb | 2023-12-20 19:03:59 -0800 | [diff] [blame] | 47 | - name: Validate IREE Compiler Package |
| 48 | id: validate_compiler_package |
| 49 | run: | |
| 50 | echo "Testing compiler package:" |
| 51 | python -m iree.compiler._package_test |
Stella Laurenzo | a2733b0 | 2023-11-08 13:22:50 -0800 | [diff] [blame] | 52 | - name: Validate IREE Runtime Package |
| 53 | id: validate_runtime_package |
| 54 | run: | |
| 55 | echo "Testing default runtime:" |
| 56 | python -m iree.runtime._package_test |
| 57 | echo "Testing tracy runtime:" |
Stella Laurenzo | 335e8b9 | 2023-11-10 10:02:28 -0800 | [diff] [blame] | 58 | # GH runners don't expose the TSC but we want to make sure the basic packaging |
| 59 | # works, so override the check with TRACY_NO_INVARIANT_CHECK=1 (per instructions |
| 60 | # if this is left off). |
| 61 | TRACY_NO_INVARIANT_CHECK=1 IREE_PY_RUNTIME=tracy \ |
| 62 | python -m iree.runtime._package_test |
Stella Laurenzo | 1799e24 | 2023-06-23 16:56:56 -0700 | [diff] [blame] | 63 | # Binaries from the tarball |
Ben Vanik | 23f2828 | 2024-02-23 11:14:25 -0800 | [diff] [blame] | 64 | - name: Run iree-benchmark-executable |
| 65 | id: run_iree_benchmark_executable |
| 66 | run: ./bin/iree-benchmark-executable --help |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 67 | - name: Run iree-benchmark-module |
| 68 | id: run_iree_benchmark_module |
| 69 | run: ./bin/iree-benchmark-module --help |
Scott Todd | 23748f6 | 2023-07-05 11:18:07 -0700 | [diff] [blame] | 70 | - name: Run iree-dump-module |
| 71 | id: run_iree_dump_module |
| 72 | run: ./bin/iree-dump-module --help |
Stella Laurenzo | 1799e24 | 2023-06-23 16:56:56 -0700 | [diff] [blame] | 73 | - name: Run iree-cpuinfo |
| 74 | id: run_iree_cpuinfo |
| 75 | run: ./bin/iree-cpuinfo |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 76 | - name: Run iree-flatcc-cli |
| 77 | id: run_iree_flatcc_cli |
| 78 | run: ./bin/iree-flatcc-cli --help |
| 79 | - name: Run iree-opt |
| 80 | id: run_iree_opt |
| 81 | run: ./bin/iree-opt --help |
| 82 | - name: Run iree-run-mlir |
| 83 | id: run_iree_run_mlir |
| 84 | run: ./bin/iree-run-mlir --help |
| 85 | - name: Run iree-run-module |
| 86 | id: run_iree_run_module |
| 87 | run: ./bin/iree-run-module --help |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 88 | - name: Run iree-tblgen |
| 89 | id: run_iree_tblgen |
| 90 | run: ./bin/iree-tblgen --help |
Stella Laurenzo | 7f2972c | 2022-03-19 14:09:43 -0700 | [diff] [blame] | 91 | - name: Run iree-compile |
| 92 | id: run_iree-compile |
| 93 | run: ./bin/iree-compile --help |
Stella Laurenzo | 1799e24 | 2023-06-23 16:56:56 -0700 | [diff] [blame] | 94 | # Console scripts from the wheels. |
| 95 | - name: Py iree-run-module |
| 96 | id: py_iree-run-module |
| 97 | run: iree-run-module --help |
Ben Vanik | 23f2828 | 2024-02-23 11:14:25 -0800 | [diff] [blame] | 98 | - name: Py iree-benchmark-executable |
| 99 | id: py_iree_benchmark_executable |
| 100 | run: iree-benchmark-executable --help |
Stella Laurenzo | 1799e24 | 2023-06-23 16:56:56 -0700 | [diff] [blame] | 101 | - name: Py iree-benchmark-module |
| 102 | id: py_iree_benchmark_module |
| 103 | run: iree-benchmark-module --help |
Scott Todd | 23748f6 | 2023-07-05 11:18:07 -0700 | [diff] [blame] | 104 | - name: Py iree-dump-module |
| 105 | id: py_iree_dump_module |
| 106 | run: iree-dump-module --help |
Stella Laurenzo | 1799e24 | 2023-06-23 16:56:56 -0700 | [diff] [blame] | 107 | - name: Py iree-cpuinfo |
| 108 | id: py_iree_cpuinfo |
| 109 | run: iree-cpuinfo |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 110 | |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 111 | publish_release: |
| 112 | name: "Publish release" |
not-jenni | 170002d | 2021-09-08 10:34:55 -0700 | [diff] [blame] | 113 | needs: validate_packages |
CindyLiu | b84d977 | 2022-10-24 13:38:32 -0700 | [diff] [blame] | 114 | runs-on: ubuntu-20.04 |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 115 | steps: |
| 116 | - name: Publish Release |
| 117 | id: publish_release |
Geoffrey Martin-Noble | 492299c | 2023-03-30 09:12:03 -0700 | [diff] [blame] | 118 | uses: eregon/publish-release@46913fa2b3f7edc7345ae3c17f6d1b093a54916d # v1.0.5 |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 119 | env: |
Geoffrey Martin-Noble | f88dd96 | 2022-12-09 10:48:51 -0800 | [diff] [blame] | 120 | GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }} |
not-jenni | 97ae6e5 | 2021-08-12 18:02:16 -0700 | [diff] [blame] | 121 | with: |
| 122 | release_id: ${{ github.event.inputs.release_id }} |
CindyLiu | 7d9e490 | 2021-08-30 08:40:52 -0700 | [diff] [blame] | 123 | |
| 124 | - name: Checking out repository |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 125 | uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 |
CindyLiu | 7d9e490 | 2021-08-30 08:40:52 -0700 | [diff] [blame] | 126 | with: |
Geoffrey Martin-Noble | f88dd96 | 2022-12-09 10:48:51 -0800 | [diff] [blame] | 127 | token: ${{ secrets.WRITE_ACCESS_TOKEN }} |
CindyLiu | 674aa9a | 2021-09-02 23:12:56 +0000 | [diff] [blame] | 128 | # Get all history. Otherwise the latest-snapshot branch can't be |
| 129 | # fast-forwarded. |
| 130 | fetch-depth: 0 |
CindyLiu | 7d9e490 | 2021-08-30 08:40:52 -0700 | [diff] [blame] | 131 | |
| 132 | - name: Updating latest-snapshot branch |
Marius Brehler | b78def2 | 2024-09-06 18:53:11 +0200 | [diff] [blame] | 133 | uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 |
CindyLiu | 7d9e490 | 2021-08-30 08:40:52 -0700 | [diff] [blame] | 134 | with: |
Geoffrey Martin-Noble | f88dd96 | 2022-12-09 10:48:51 -0800 | [diff] [blame] | 135 | github_token: ${{ secrets.WRITE_ACCESS_TOKEN }} |
CindyLiu | 674aa9a | 2021-09-02 23:12:56 +0000 | [diff] [blame] | 136 | branch: latest-snapshot |
powderluv | 22112e0 | 2022-04-12 22:23:12 -0700 | [diff] [blame] | 137 | force: true |