2024-01-28 07:48:06 +08:00
|
|
|
# yamllint disable rule:line-length
|
2021-10-06 07:26:26 +08:00
|
|
|
name: Release snapshot package
|
|
|
|
|
|
|
|
on:
|
|
|
|
schedule:
|
2022-06-05 13:40:53 +08:00
|
|
|
- cron: '0 11 * * *'
|
2021-10-06 07:26:26 +08:00
|
|
|
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
release_snapshot_package:
|
|
|
|
name: "Tag snapshot release"
|
CI script improvements (#1547)
* ci: update versions of external actions
Node.js 12 actions are deprecated and will eventually go away, so this
patch bumps the old actions to their latest versions that use Node.js
16.
* ci: replace deprecated action with bash commands
The llvm/actions/install-ninja action uses Node.js 12, which is
deprecated. Since that action is not updated to work with Node.js 16,
this patch replaces that action with equivalent bash commands to install
Ninja.
* ci: use smaller ccache artifacts to reduce evictions
Over time, our ccache sizes have grown quite large (some as large as
1.3 GB), which results in us routinely exceeding GitHub's limits, thus
triggering frequent cache evictions. As a result, cache downloads and
uploads take unnecessary long, in addition to fewer cache entries being
available.
Based on experiments on a clean cache state, it appears that we need
less than 300 MB of (compressed) ccache artifacts for each build type.
Anything larger than that will accrue changes from the past that aren't
needed.
To alleviate the cache burden, this patch sets the maximum ccache size
to be 300 MB. This change should not affect the success or failure of
our builds. I will monitor the build times to check whether this change
causes any performance degradation.
* ci: use consistent platform identifiers
Prior to this patch, some of our builds ran on `ubuntu-latest`, while
some others ran on `ubuntu-20.04` and others ran on `ubuntu-22.04`, with
similar situations for macOS and windows. This patch instead sets all
Linux builds to run on `ubuntu-latest`, all macOS builds to run on
`macos-latest`, and all Windows builds to run on `windows-latest`, to
make debugging future CI failures a little easier.
2022-11-03 10:37:01 +08:00
|
|
|
runs-on: ubuntu-latest
|
2021-10-06 07:26:26 +08:00
|
|
|
# Don't run this in everyone's forks.
|
|
|
|
if: github.repository == 'llvm/torch-mlir'
|
|
|
|
steps:
|
2023-02-25 04:44:35 +08:00
|
|
|
|
2023-04-07 01:36:30 +08:00
|
|
|
- name: Prepare workspace
|
|
|
|
run: |
|
|
|
|
# Clear the workspace directory so that we don't run into errors about
|
|
|
|
# existing lock files.
|
|
|
|
sudo rm -rf $GITHUB_WORKSPACE/*
|
|
|
|
|
2021-10-06 07:26:26 +08:00
|
|
|
- name: Checking out repository
|
2023-02-25 04:44:35 +08:00
|
|
|
uses: actions/checkout@v3
|
2021-10-06 07:26:26 +08:00
|
|
|
with:
|
|
|
|
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
|
|
|
|
|
|
|
|
- name: Compute version
|
|
|
|
run: |
|
|
|
|
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
|
|
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
|
|
|
|
tag_name="snapshot-${package_version}"
|
|
|
|
echo "package_version=${package_version}" >> $GITHUB_ENV
|
|
|
|
echo "tag_name=${tag_name}" >> $GITHUB_ENV
|
|
|
|
|
|
|
|
- name: Updating snapshot tag
|
|
|
|
run: |
|
|
|
|
git tag "${tag_name}"
|
|
|
|
|
|
|
|
- name: Pushing changes
|
|
|
|
uses: ad-m/github-push-action@v0.6.0
|
|
|
|
with:
|
|
|
|
github_token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
|
|
|
|
branch: main
|
|
|
|
tags: true
|
|
|
|
|
|
|
|
- name: Create Release
|
|
|
|
id: create_release
|
|
|
|
uses: actions/create-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
|
|
|
|
with:
|
|
|
|
tag_name: ${{ env.tag_name }}
|
|
|
|
release_name: torch-mlir snapshot ${{ env.tag_name }}
|
|
|
|
body: |
|
|
|
|
Automatic snapshot release of torch-mlir.
|
|
|
|
draft: true
|
2022-03-30 08:33:11 +08:00
|
|
|
prerelease: false
|
2021-10-06 07:26:26 +08:00
|
|
|
|
|
|
|
- name: "Invoke workflow :: Build and Test"
|
|
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
|
|
with:
|
|
|
|
workflow: Build and Test
|
|
|
|
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
|
|
|
|
ref: "${{ env.tag_name }}"
|
2022-04-22 09:46:34 +08:00
|
|
|
|
|
|
|
- name: "Invoke workflow :: Release Build"
|
|
|
|
uses: benc-uk/workflow-dispatch@v1
|
|
|
|
with:
|
|
|
|
workflow: Release Build
|
|
|
|
token: ${{ secrets.WORKFLOW_INVOCATION_TOKEN }}
|
|
|
|
ref: "${{ env.tag_name }}"
|
2022-03-31 01:51:52 +08:00
|
|
|
inputs: '{"release_id": "${{ steps.create_release.outputs.id }}", "python_package_version": "${{ env.package_version }}"}'
|