Skip to content

Instantly share code, notes, and snippets.

@exoego
Created November 25, 2021 06:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exoego/bbb281cbc55e07b865eb44c218675f66 to your computer and use it in GitHub Desktop.
Save exoego/bbb281cbc55e07b865eb44c218675f66 to your computer and use it in GitHub Desktop.
GitHub Actions to update Rust aws-sdk crates
name: Update AWS SDK crates daily
on:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: oprypin/find-latest-tag@v1
with:
repository: awslabs/aws-sdk-rust
releases-only: true
id: RELEASE_TAG
- name: Strip v prefix
uses: frabert/replace-string-action@v2.0
with:
string: '${{ steps.RELEASE_TAG.outputs.tag }}'
pattern: 'v(.+)'
replace-with: '$1'
id: CRATE_TAG
- name: Update Cargo.toml
uses: jacobtomlinson/gha-find-replace@v2
with:
# Requires "# AWS_SDK_RUST" as marker comment to identity aws-sdk crates
find: '".+" # AWS_SDK_RUST'
replace: '"${{ steps.CRATE_TAG.outputs.replaced }}" # AWS_SDK_RUST'
include: "**/Cargo.toml"
regex: true
- uses: actions-rs/toolchain@v1
with:
profile: default
toolchain: stable
- name: Update Cargo.lock
run: cargo update
- name: Creates a PR
uses: peter-evans/create-pull-request@v3
with:
base: "main"
commit-message: "Update aws-sdk to ${{ steps.RELEASE_TAG.outputs.tag }}"
title: "Update aws-sdk to ${{ steps.RELEASE_TAG.outputs.tag }}"
body: Release notes: https://github.com/awslabs/aws-sdk-rust/releases/tag/${{ steps.AWS_SDK_RUST.outputs.tag }}
branch: "aws-sdk/${{ steps.RELEASE_TAG.outputs.tag }}"
delete-branch: true
@allimn
Copy link

allimn commented Nov 30, 2021

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment