-
Notifications
You must be signed in to change notification settings - Fork 66
59 lines (50 loc) · 1.85 KB
/
update-release.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
name: Check for a new Rust release
on:
# Allow for this to be manually run.
workflow_dispatch:
inputs:
version:
description: 'Rust release version'
type: string
# Run at midnight every day.
schedule:
- cron: '0 0 * * *'
jobs:
check_for_update:
name: Check if there is a new release
env:
version: ${{inputs.version}}
outputs:
release_version: ${{ steps.check.outputs.version }}
runs-on: ubuntu-latest
steps:
- name: Get the latest release tag name
if: env.version == ''
env:
GH_TOKEN: ${{ github.token }}
run: echo "version=$(gh release view --repo rust-lang/rust --json tagName --jq '.tagName')" >> "$GITHUB_ENV"
- uses: actions/checkout@v4
- name: Check if we already have the latest release
id: check
run: test -f "recipes-devtools/rust/rust-bin-cross_${version}.bb" || echo "version=${version}" >> "$GITHUB_OUTPUT"
create_pr:
name: Create release PR
needs: check_for_update
if: needs.check_for_update.outputs.release_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Generate new files for the release
run: ./build-new-version.sh ${{needs.check_for_update.outputs.release_version}}
- name: Commit new files
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: feature/rust-${{needs.check_for_update.outputs.release_version}}
create_branch: true
commit_message: "Rust ${{needs.check_for_update.outputs.release_version}}"
add_options: '--all'
push_options: '--force'
- name: Create pull request
env:
GH_TOKEN: ${{ github.token }}
run: gh pr create --title "Rust ${{needs.check_for_update.outputs.release_version}}" --body "Automatically generated by update-release.yml"