| # Publishes a draft snapshot, after performing validation to make sure all linux | |
| # packages are stable. | |
| name: Validate and Publish Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| release_id: | |
| description: "Release id to publish" | |
| required: true | |
| package_version: | |
| description: "Version of the package" | |
| required: true | |
| build_run_id: | |
| description: "Run ID for the build_package.yml workflow that triggered this workflow" | |
| required: true | |
| jobs: | |
| validate_packages: | |
| name: "Validate packages" | |
| # TODO(jennik): Look into testing windows and macos builds. | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - name: Download packages | |
| id: download_packages | |
| uses: dawidd6/action-download-artifact@b2abf1705491048a2d7074f7d90513044fd25d39 # v2 | |
| with: | |
| github_token: ${{secrets.WRITE_ACCESS_TOKEN}} | |
| workflow: build_package.yml | |
| run_id: ${{ github.event.inputs.build_run_id }} | |
| - name: Extract and display downloaded files | |
| run: | | |
| tar -xf artifact/iree-dist-${{ github.event.inputs.package_version }}-linux-x86_64.tar.xz | |
| pwd | |
| ls -R | |
| - name: Set up python | |
| id: set_up_python | |
| uses: actions/setup-python@75f3110429a8c05be0e1bf360334e4cced2b63fa # v2.3.3 | |
| with: | |
| python-version: "3.8" | |
| - name: Install python packages | |
| id: install_python_packages | |
| run: | | |
| python -m pip install -f file://$PWD/artifact/ iree-compiler iree-runtime iree-tools-tflite iree-tools-tf iree-tools-xla | |
| - name: Run iree-benchmark-module | |
| id: run_iree_benchmark_module | |
| run: ./bin/iree-benchmark-module --help | |
| - name: Run iree-benchmark-trace | |
| id: run_iree_benchmark_trace | |
| run: ./bin/iree-benchmark-trace --help | |
| - name: Run iree-flatcc-cli | |
| id: run_iree_flatcc_cli | |
| run: ./bin/iree-flatcc-cli --help | |
| - name: Run iree-opt | |
| id: run_iree_opt | |
| run: ./bin/iree-opt --help | |
| - name: Run iree-run-mlir | |
| id: run_iree_run_mlir | |
| run: ./bin/iree-run-mlir --help | |
| - name: Run iree-run-module | |
| id: run_iree_run_module | |
| run: ./bin/iree-run-module --help | |
| - name: Run iree-run-trace | |
| id: run_iree_run_trace | |
| run: ./bin/iree-run-trace --help | |
| - name: Run iree-tblgen | |
| id: run_iree_tblgen | |
| run: ./bin/iree-tblgen --help | |
| - name: Run iree-compile | |
| id: run_iree-compile | |
| run: ./bin/iree-compile --help | |
| publish_release: | |
| name: "Publish release" | |
| needs: validate_packages | |
| runs-on: ubuntu-20.04 | |
| steps: | |
| - name: Publish Release | |
| id: publish_release | |
| uses: eregon/publish-release@d6aee8c288e653387d895ee64d559fc0dd63339d # v1.0.3 | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
| with: | |
| release_id: ${{ github.event.inputs.release_id }} | |
| - name: Checking out repository | |
| uses: actions/checkout@e2f20e631ae6d7dd3b768f56a5d2af784dd54791 # v2.5.0 | |
| with: | |
| token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
| # Get all history. Otherwise the latest-snapshot branch can't be | |
| # fast-forwarded. | |
| fetch-depth: 0 | |
| - name: Updating latest-snapshot branch | |
| uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6 # v0.6.0 | |
| with: | |
| github_token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
| branch: latest-snapshot | |
| force: true |