forked from llvm/torch-mlir
-
Notifications
You must be signed in to change notification settings - Fork 5
89 lines (77 loc) · 3.01 KB
/
releaseSnapshotPackage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
# yamllint disable rule:line-length
name: Release snapshot package
on:
# schedule:
# - cron: '0 11 * * *'
workflow_dispatch:
jobs:
release_snapshot_package:
name: "Tag snapshot release"
runs-on: ubuntu-latest
# Don't run this in everyone's forks.
#if: github.repository == 'llvm/torch-mlir'
permissions:
contents: write
actions: write
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
steps:
- 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/*
- name: Checking out repository
uses: actions/checkout@v3
- 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/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ env.BRANCH_NAME }}
tags: true
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag_name }}
release_name: torch-mlir snapshot ${{ env.tag_name }}
body: |
Automatic snapshot release of torch-mlir.
draft: true
prerelease: false
# - name: "Invoke workflow :: Build and Test"
# uses: benc-uk/workflow-dispatch@v1
# with:
# workflow: Build and Test
# ref: "${{ env.tag_name }}"
- name: "Invoke workflow :: Release Build"
uses: benc-uk/workflow-dispatch@v1
with:
workflow: Release Build
ref: "${{ env.tag_name }}"
inputs: '{"release_id": "${{ steps.create_release.outputs.id }}", "python_package_version": "${{ env.package_version }}"}'
- name: Download nightly pytorch and torchvision wheels
run: |
pip download -r pytorch-requirements.txt -r torchvision-requirements.txt --no-deps --dest deps --python-version 3.8
pip download -r pytorch-requirements.txt -r torchvision-requirements.txt --no-deps --dest deps --python-version 3.10
pip download -r pytorch-requirements.txt -r torchvision-requirements.txt --no-deps --dest deps --python-version 3.11
- name: Upload nightly pytorch and torchvision wheels into release
id: upload-release-assets-nightly
uses: dwenegar/upload-release-assets@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}
assets_path: ./deps/*.whl