Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 1 | name: Schedule snapshot release |
| 2 | |
| 3 | on: |
| 4 | schedule: |
Stella Laurenzo | 06eb474 | 2021-10-01 05:00:07 +0000 | [diff] [blame] | 5 | - cron: '0 6,18 * * *' |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 6 | |
| 7 | workflow_dispatch: |
| 8 | |
| 9 | jobs: |
| 10 | tag_release: |
| 11 | name: "Tag snapshot release" |
| 12 | runs-on: ubuntu-18.04 |
Geoffrey Martin-Noble | 5f9d4d8 | 2021-09-03 10:18:46 -0700 | [diff] [blame] | 13 | # Don't run this in everyone's forks. |
| 14 | if: github.repository == 'google/iree' |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 15 | steps: |
| 16 | - name: Checking out repository |
| 17 | uses: actions/checkout@v2 |
| 18 | with: |
Geoffrey Martin-Noble | 5c5b549 | 2021-05-20 16:55:41 -0700 | [diff] [blame] | 19 | token: ${{ secrets.WRITE_ACCESS_TOKEN }} |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 20 | |
| 21 | - name: Compute version |
| 22 | run: | |
Stella Laurenzo | 29f1596 | 2021-01-04 18:50:11 -0800 | [diff] [blame] | 23 | git fetch --depth=1 origin +refs/tags/*:refs/tags/* |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 24 | package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')" |
| 25 | tag_name="snapshot-${package_version}" |
| 26 | echo "package_version=${package_version}" >> $GITHUB_ENV |
| 27 | echo "tag_name=${tag_name}" >> $GITHUB_ENV |
| 28 | |
| 29 | - name: Updating snapshot tag |
| 30 | run: | |
| 31 | git tag "${tag_name}" |
| 32 | |
| 33 | - name: Pushing changes |
| 34 | uses: ad-m/github-push-action@v0.6.0 |
| 35 | with: |
Geoffrey Martin-Noble | 5c5b549 | 2021-05-20 16:55:41 -0700 | [diff] [blame] | 36 | github_token: ${{ secrets.WRITE_ACCESS_TOKEN }} |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 37 | branch: main |
| 38 | tags: true |
| 39 | |
| 40 | - name: Create Release |
| 41 | id: create_release |
| 42 | uses: actions/create-release@v1 |
| 43 | env: |
Geoffrey Martin-Noble | 5c5b549 | 2021-05-20 16:55:41 -0700 | [diff] [blame] | 44 | GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }} |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 45 | with: |
| 46 | tag_name: ${{ env.tag_name }} |
| 47 | release_name: iree snapshot ${{ env.tag_name }} |
| 48 | body: | |
| 49 | Automatic snapshot release of iree. |
| 50 | draft: true |
| 51 | prerelease: true |
| 52 | |
| 53 | - name: "Invoke workflow :: Build Native Release Packages" |
| 54 | uses: benc-uk/workflow-dispatch@v1 |
| 55 | with: |
| 56 | workflow: Build Native Release Packages |
Geoffrey Martin-Noble | 5c5b549 | 2021-05-20 16:55:41 -0700 | [diff] [blame] | 57 | token: ${{ secrets.WRITE_ACCESS_TOKEN }} |
Stella Laurenzo | bd6cf1f | 2021-01-04 18:39:27 -0800 | [diff] [blame] | 58 | ref: "${{ env.tag_name }}" |
| 59 | inputs: '{"package_suffix": "-snapshot", "package_version": "${{ env.package_version }}", "release_id": "${{ steps.create_release.outputs.id }}"}' |