mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-17 18:06:59 +02:00
Merge pull request #90 from flatcar-linux/kai/migrate-github-actions
Migrate GitHub actions
This commit is contained in:
commit
d5d3368cf2
16
sdk_container/src/third_party/portage-stable/.github/workflows/rust-apply-patch.sh
vendored
Executable file
16
sdk_container/src/third_party/portage-stable/.github/workflows/rust-apply-patch.sh
vendored
Executable file
@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
git fetch origin
|
||||
git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}"
|
||||
|
||||
pushd "virtual/rust" >/dev/null || exit
|
||||
VERSION_OLD=$(ls -1 rust-*.ebuild | sed -n "s/rust-\(1.[0-9]*.[0-9]*\).ebuild/\1/p" | sort -ruV | head -n1)
|
||||
git mv rust-${VERSION_OLD}.ebuild "rust-${VERSION_NEW}.ebuild"
|
||||
# For a complete update we would need to download the upstream ebuild and apply our crossdev patch.
|
||||
# Automating this is not done yet and maybe would not work well either and had the same result as just renaming
|
||||
# which we did here and has the same effect for minor updates that do not touch the ebuild logic.
|
||||
popd >/dev/null || exit
|
||||
|
||||
echo ::set-output name=VERSION_OLD::"${VERSION_OLD}"
|
37
sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-main.yml
vendored
Normal file
37
sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-main.yml
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
on:
|
||||
repository_dispatch:
|
||||
types: [cargo-pull-request-main]
|
||||
|
||||
jobs:
|
||||
flatcar-rust-prs:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
GIT_SSH_COMMAND: "ssh -o StrictHostKeyChecking=no"
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Fetch latest Cargo release
|
||||
id: fetch-latest-release
|
||||
run: |
|
||||
git clone --depth=1 --no-checkout https://github.com/rust-lang/rust
|
||||
versionMain=$(git -C rust ls-remote --tags origin | cut -f2 | sed -n "/refs\/tags\/1.[0-9]*.[0-9]*$/s/^refs\/tags\///p" | sort -ruV | head -n1)
|
||||
rm -rf rust
|
||||
echo ::set-output name=VERSION_MAIN::$(echo ${versionMain})
|
||||
echo ::set-output name=BASE_BRANCH_MAIN::main
|
||||
- name: Apply patch for main
|
||||
id: apply-patch-main
|
||||
env:
|
||||
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }}
|
||||
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
|
||||
run: .github/workflows/rust-apply-patch.sh
|
||||
- name: Create pull request for main
|
||||
uses: peter-evans/create-pull-request@v2
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }}
|
||||
branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main
|
||||
author: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
||||
committer: Flatcar Buildbot <buildbot@flatcar-linux.org>
|
||||
title: Upgrade Cargo in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
|
||||
commit-message: Upgrade Cargo in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
|
||||
body: Upgrade Cargo in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
|
||||
labels: main
|
Loading…
Reference in New Issue
Block a user