.github: Only update the new main branch

The new main branch is the only branch that should get new software
updates (with the exception of the maintenance branches that get kernel
updates).
This commit is contained in:
Kai Lüke 2020-07-24 11:10:42 +02:00
parent bdc2dc8405
commit 042515d58f
2 changed files with 15 additions and 52 deletions

View File

@ -1,37 +0,0 @@
on:
repository_dispatch:
types: [cargo-pull-request-alpha]
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
versionAlpha=$(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_ALPHA::$(echo ${versionAlpha})
echo ::set-output name=BASE_BRANCH_ALPHA::main
- name: Apply patch for Alpha
id: apply-patch-alpha
env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
run: .github/workflows/rust-apply-patch.sh
- name: Create pull request for Alpha
uses: peter-evans/create-pull-request@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_ALPHA }}
branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}-alpha
author: Flatcar Buildbot <buildbot@flatcar-linux.org>
committer: Flatcar Buildbot <buildbot@flatcar-linux.org>
title: Upgrade Cargo in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
commit-message: Upgrade Cargo in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
body: Upgrade Cargo in Alpha from ${{ steps.apply-patch-alpha.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_ALPHA }}
labels: alpha

View File

@ -1,6 +1,6 @@
on: on:
repository_dispatch: repository_dispatch:
types: [cargo-pull-request-edge] types: [cargo-pull-request-main]
jobs: jobs:
flatcar-rust-prs: flatcar-rust-prs:
@ -13,25 +13,25 @@ jobs:
id: fetch-latest-release id: fetch-latest-release
run: | run: |
git clone --depth=1 --no-checkout https://github.com/rust-lang/rust git clone --depth=1 --no-checkout https://github.com/rust-lang/rust
versionEdge=$(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) 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 rm -rf rust
echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) echo ::set-output name=VERSION_MAIN::$(echo ${versionMain})
echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge echo ::set-output name=BASE_BRANCH_MAIN::main
- name: Apply patch for Edge - name: Apply patch for main
id: apply-patch-edge id: apply-patch-main
env: env:
BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} BASE_BRANCH: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }}
VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
run: .github/workflows/rust-apply-patch.sh run: .github/workflows/rust-apply-patch.sh
- name: Create pull request for Edge - name: Create pull request for main
uses: peter-evans/create-pull-request@v2 uses: peter-evans/create-pull-request@v2
with: with:
token: ${{ secrets.GITHUB_TOKEN }} token: ${{ secrets.GITHUB_TOKEN }}
base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_EDGE }} base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }}
branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main
author: Flatcar Buildbot <buildbot@flatcar-linux.org> author: Flatcar Buildbot <buildbot@flatcar-linux.org>
committer: Flatcar Buildbot <buildbot@flatcar-linux.org> committer: Flatcar Buildbot <buildbot@flatcar-linux.org>
title: Upgrade Cargo in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} 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 Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} 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 Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} body: Upgrade Cargo in main from ${{ steps.apply-patch-main.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}
labels: edge labels: main