blob: 1d8afccb0bf54b03195c93bfba4debe49a2bcb38 [file] [log] [blame]
not-jenni170002d2021-09-08 10:34:55 -07001# Publishes a draft snapshot, after performing validation to make sure all linux
2# packages are stable.
not-jenni97ae6e52021-08-12 18:02:16 -07003name: Validate and Publish Release
4
5on:
6 workflow_dispatch:
7 inputs:
8 release_id:
Geoffrey Martin-Nobleb22c9312022-07-28 08:47:29 -07009 description: "Release id to publish"
not-jenni97ae6e52021-08-12 18:02:16 -070010 required: true
not-jenni170002d2021-09-08 10:34:55 -070011 package_version:
Geoffrey Martin-Nobleb22c9312022-07-28 08:47:29 -070012 description: "Version of the package"
not-jenni170002d2021-09-08 10:34:55 -070013 required: true
14 build_run_id:
Geoffrey Martin-Nobleb22c9312022-07-28 08:47:29 -070015 description: "Run ID for the build_package.yml workflow that triggered this workflow"
not-jenni170002d2021-09-08 10:34:55 -070016 required: true
not-jenni97ae6e52021-08-12 18:02:16 -070017
18jobs:
not-jenni170002d2021-09-08 10:34:55 -070019 validate_packages:
20 name: "Validate packages"
21 # TODO(jennik): Look into testing windows and macos builds.
CindyLiub84d9772022-10-24 13:38:32 -070022 runs-on: ubuntu-20.04
not-jenni170002d2021-09-08 10:34:55 -070023 steps:
24 - name: Download packages
25 id: download_packages
Geoffrey Martin-Noble492299c2023-03-30 09:12:03 -070026 uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
not-jenni170002d2021-09-08 10:34:55 -070027 with:
Geoffrey Martin-Noblef88dd962022-12-09 10:48:51 -080028 github_token: ${{secrets.WRITE_ACCESS_TOKEN}}
not-jenni170002d2021-09-08 10:34:55 -070029 workflow: build_package.yml
30 run_id: ${{ github.event.inputs.build_run_id }}
31 - name: Extract and display downloaded files
32 run: |
Scott Toddfc212da2024-06-27 09:59:54 -070033 tar -xf wheels-linux-x86_64-main-dist-linux/iree-dist-${{ github.event.inputs.package_version }}-linux-x86_64.tar.xz
not-jenni170002d2021-09-08 10:34:55 -070034 pwd
35 ls -R
36 - name: Set up python
37 id: set_up_python
Marius Brehlerb78def22024-09-06 18:53:11 +020038 uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.1.0
not-jenni170002d2021-09-08 10:34:55 -070039 with:
Han-Chung Wang9ed3dab2023-08-30 14:25:24 -070040 python-version: "3.9"
not-jenni170002d2021-09-08 10:34:55 -070041 - name: Install python packages
42 id: install_python_packages
43 run: |
Scott Toddfc212da2024-06-27 09:59:54 -070044 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 Laurenzo7b7ffeb2023-12-20 19:03:59 -080047 - 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 Laurenzoa2733b02023-11-08 13:22:50 -080052 - 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 Laurenzo335e8b92023-11-10 10:02:28 -080058 # 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 Laurenzo1799e242023-06-23 16:56:56 -070063 # Binaries from the tarball
Ben Vanik23f28282024-02-23 11:14:25 -080064 - name: Run iree-benchmark-executable
65 id: run_iree_benchmark_executable
66 run: ./bin/iree-benchmark-executable --help
not-jenni170002d2021-09-08 10:34:55 -070067 - name: Run iree-benchmark-module
68 id: run_iree_benchmark_module
69 run: ./bin/iree-benchmark-module --help
Scott Todd23748f62023-07-05 11:18:07 -070070 - name: Run iree-dump-module
71 id: run_iree_dump_module
72 run: ./bin/iree-dump-module --help
Stella Laurenzo1799e242023-06-23 16:56:56 -070073 - name: Run iree-cpuinfo
74 id: run_iree_cpuinfo
75 run: ./bin/iree-cpuinfo
not-jenni170002d2021-09-08 10:34:55 -070076 - 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-jenni170002d2021-09-08 10:34:55 -070088 - name: Run iree-tblgen
89 id: run_iree_tblgen
90 run: ./bin/iree-tblgen --help
Stella Laurenzo7f2972c2022-03-19 14:09:43 -070091 - name: Run iree-compile
92 id: run_iree-compile
93 run: ./bin/iree-compile --help
Stella Laurenzo1799e242023-06-23 16:56:56 -070094 # Console scripts from the wheels.
95 - name: Py iree-run-module
96 id: py_iree-run-module
97 run: iree-run-module --help
Ben Vanik23f28282024-02-23 11:14:25 -080098 - name: Py iree-benchmark-executable
99 id: py_iree_benchmark_executable
100 run: iree-benchmark-executable --help
Stella Laurenzo1799e242023-06-23 16:56:56 -0700101 - name: Py iree-benchmark-module
102 id: py_iree_benchmark_module
103 run: iree-benchmark-module --help
Scott Todd23748f62023-07-05 11:18:07 -0700104 - name: Py iree-dump-module
105 id: py_iree_dump_module
106 run: iree-dump-module --help
Stella Laurenzo1799e242023-06-23 16:56:56 -0700107 - name: Py iree-cpuinfo
108 id: py_iree_cpuinfo
109 run: iree-cpuinfo
not-jenni170002d2021-09-08 10:34:55 -0700110
not-jenni97ae6e52021-08-12 18:02:16 -0700111 publish_release:
112 name: "Publish release"
not-jenni170002d2021-09-08 10:34:55 -0700113 needs: validate_packages
CindyLiub84d9772022-10-24 13:38:32 -0700114 runs-on: ubuntu-20.04
not-jenni97ae6e52021-08-12 18:02:16 -0700115 steps:
116 - name: Publish Release
117 id: publish_release
Geoffrey Martin-Noble492299c2023-03-30 09:12:03 -0700118 uses: eregon/publish-release@46913fa2b3f7edc7345ae3c17f6d1b093a54916d # v1.0.5
not-jenni97ae6e52021-08-12 18:02:16 -0700119 env:
Geoffrey Martin-Noblef88dd962022-12-09 10:48:51 -0800120 GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }}
not-jenni97ae6e52021-08-12 18:02:16 -0700121 with:
122 release_id: ${{ github.event.inputs.release_id }}
CindyLiu7d9e4902021-08-30 08:40:52 -0700123
124 - name: Checking out repository
Marius Brehlerb78def22024-09-06 18:53:11 +0200125 uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
CindyLiu7d9e4902021-08-30 08:40:52 -0700126 with:
Geoffrey Martin-Noblef88dd962022-12-09 10:48:51 -0800127 token: ${{ secrets.WRITE_ACCESS_TOKEN }}
CindyLiu674aa9a2021-09-02 23:12:56 +0000128 # Get all history. Otherwise the latest-snapshot branch can't be
129 # fast-forwarded.
130 fetch-depth: 0
CindyLiu7d9e4902021-08-30 08:40:52 -0700131
132 - name: Updating latest-snapshot branch
Marius Brehlerb78def22024-09-06 18:53:11 +0200133 uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0
CindyLiu7d9e4902021-08-30 08:40:52 -0700134 with:
Geoffrey Martin-Noblef88dd962022-12-09 10:48:51 -0800135 github_token: ${{ secrets.WRITE_ACCESS_TOKEN }}
CindyLiu674aa9a2021-09-02 23:12:56 +0000136 branch: latest-snapshot
powderluv22112e02022-04-12 22:23:12 -0700137 force: true