From 042515d58fb4ccee491383bad7577c6d3aa5ac26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kai=20L=C3=BCke?= Date: Fri, 24 Jul 2020 11:10:42 +0200 Subject: [PATCH] .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). --- .../workflows/rust-pull-request-alpha.yml | 37 ------------------- ...st-edge.yml => rust-pull-request-main.yml} | 30 +++++++-------- 2 files changed, 15 insertions(+), 52 deletions(-) delete mode 100644 sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-alpha.yml rename sdk_container/src/third_party/portage-stable/.github/workflows/{rust-pull-request-edge.yml => rust-pull-request-main.yml} (53%) diff --git a/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-alpha.yml b/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-alpha.yml deleted file mode 100644 index 2d4f941727..0000000000 --- a/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-alpha.yml +++ /dev/null @@ -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 - committer: Flatcar Buildbot - 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 diff --git a/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-edge.yml b/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-main.yml similarity index 53% rename from sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-edge.yml rename to sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-main.yml index 372ab64893..109301491f 100644 --- a/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-edge.yml +++ b/sdk_container/src/third_party/portage-stable/.github/workflows/rust-pull-request-main.yml @@ -1,6 +1,6 @@ on: repository_dispatch: - types: [cargo-pull-request-edge] + types: [cargo-pull-request-main] jobs: flatcar-rust-prs: @@ -13,25 +13,25 @@ jobs: id: fetch-latest-release run: | 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 - echo ::set-output name=VERSION_EDGE::$(echo ${versionEdge}) - echo ::set-output name=BASE_BRANCH_EDGE::flatcar-master-edge - - name: Apply patch for Edge - id: apply-patch-edge + 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_EDGE }} - VERSION_NEW: ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} + 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 Edge + - 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_EDGE }} - branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_EDGE }}-edge + base: ${{ steps.fetch-latest-release.outputs.BASE_BRANCH_MAIN }} + branch: rust-${{ steps.fetch-latest-release.outputs.VERSION_MAIN }}-main author: Flatcar Buildbot committer: Flatcar Buildbot - title: 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 Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - body: Upgrade Cargo in Edge from ${{ steps.apply-patch-edge.outputs.VERSION_OLD }} to ${{ steps.fetch-latest-release.outputs.VERSION_EDGE }} - labels: 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 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