Get the latest Rust release for main #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Get the latest Rust release for main | |
on: | |
schedule: | |
- cron: '20 7 * * 2' | |
workflow_dispatch: | |
jobs: | |
get-rust-release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out scripts | |
uses: actions/checkout@v3 | |
with: | |
token: ${{ secrets.BOT_PR_TOKEN }} | |
path: scripts | |
- name: Figure out latest Rust release version | |
id: rust-latest-release | |
run: | | |
version=$(git ls-remote --tags 'https://github.com/rust-lang/rust' | cut -f2 | sed -n "/refs\/tags\/1\.[0-9]*\.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1) | |
echo "VERSION_NEW=${version}" >>"${GITHUB_OUTPUT}" | |
- name: Set up Flatcar SDK | |
id: setup-flatcar-sdk | |
env: | |
WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" | |
CHANNEL: main | |
run: scripts/.github/workflows/setup-flatcar-sdk.sh | |
- name: Apply patch for main | |
id: apply-patch-main | |
env: | |
GHA_SCRIPTS_DIR: "${{ github.workspace }}/scripts" | |
WORK_SCRIPTS_DIR: "${{ github.workspace }}/scripts" | |
VERSION_NEW: ${{ steps.rust-latest-release.outputs.VERSION_NEW }} | |
PACKAGES_CONTAINER: ${{ steps.setup-flatcar-sdk.outputs.PACKAGES_CONTAINER }} | |
SDK_NAME: ${{ steps.setup-flatcar-sdk.outputs.SDK_NAME }} | |
TARGET_BRANCH: main | |
run: scripts/.github/workflows/rust-apply-patch.sh | |
- name: Create pull request for main | |
id: create-pull-request | |
uses: peter-evans/create-pull-request@v5 | |
if: steps.apply-patch-main.outputs.UPDATE_NEEDED == 1 | |
with: | |
token: ${{ secrets.BOT_PR_TOKEN }} | |
path: scripts | |
branch: rust-${{ steps.rust-latest-release.outputs.VERSION_NEW }}-main | |
base: main | |
title: Upgrade dev-lang/rust and virtual/rust in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.rust-latest-release.outputs.VERSION_NEW }} | |
body: Subject says it all. | |
labels: main |