-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (43 loc) · 1.78 KB
/
update-rust-docker-images.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
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