Update Cirrus-CI Rust Docker Images #40
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: Update Cirrus-CI Rust Docker Images | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main, release* ] | |
schedule: | |
- cron: "0 6 * * 0" # Run every Sunday at 6 am | |
workflow_dispatch: | |
jobs: | |
check-latest-rust-version-and-create-pull-request: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@v1 | |
with: | |
toolchain: stable | |
components: llvm-tools-preview | |
- name: Get version of latest Rust release | |
run: | | |
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal --no-modify-path | |
rustup install stable | |
export LATEST_RUST_RELEASE=$(rustc --version | cut -d' ' -f2) | |
echo "LATEST_RUST_RELEASE: $LATEST_RUST_RELEASE" | |
- name: Update docker files | |
run: | | |
export EXPECTED_RUST_VERSION_ENV="EXPECTED_RUST_VERSION=\"${LATEST_RUST_RELEASE}\"" | |
export PATH_TO_DOCKER_FILES="internal/docker" | |
find "${PATH_TO_DOCKER_FILES}" -type f -exec sed -i "s/EXPECTED_RUST_VERSION='.*'/${EXPECTED_RUST_VERSION_ENV}/" {} \; | |
echo "LATEST_RUST_RELEASE: $LATEST_RUST_RELEASE" | |
echo "EXPECTED_RUST_VERSION_ENV: $EXPECTED_RUST_VERSION_ENV" | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
commit-message: "[#8] Update Cirrus-CI Rust Docker images" | |
title: elk-#8 Update Cirrus-CI Rust Docker images | |
body: | | |
Update Cirrus-CI Rust Docker images to latest Rust release | |
Auto-generated by [create-pull-request][1] | |
[1]: https://github.com/peter-evans/create-pull-request | |
branch: elk-8-update-cirrus-ci-rust-docker-images | |
base: main |