diff --git a/.github/workflows/rebase-release-branch.yml b/.github/workflows/rebase-release-branch.yml deleted file mode 100644 index d3fe8aecc86..00000000000 --- a/.github/workflows/rebase-release-branch.yml +++ /dev/null @@ -1,63 +0,0 @@ -# -# Copyright (c) 2021-2024 Red Hat, Inc. -# This program and the accompanying materials are made -# available under the terms of the Eclipse Public License 2.0 -# which is available at https://www.eclipse.org/legal/epl-2.0/ -# -# SPDX-License-Identifier: EPL-2.0 -# - -name: rebase-release - -# Trigger on demand or every 12 hour -on: - workflow_dispatch: - schedule: - - cron: "10 */12 * * *" - -jobs: - - rebase-release: - name: rebase - runs-on: ubuntu-22.04 - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - fetch-depth: 0 - token: ${{ secrets.CHE_INCUBATOR_BOT_TOKEN }} - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - name: configure git - run: | - git config --global user.email "fbenoit+sync-checode@redhat.com" - git config --global user.name "Eclipse Che Sync" - - name: pickup-latest-release branch - run: | - LATEST_REMOTE_RELEASE_BRANCH=$(git branch -r --sort=-committerdate -l 'origin/1.*.x' | head -n 1 | tr -d '[:space:]') - LATEST_RELEASE_BRANCH=$(echo "${LATEST_REMOTE_RELEASE_BRANCH/origin\//}") - UPSTREAM_CODE_VERSION=$(sed 's|origin\/\(.*\).x|\1|' <<< "${LATEST_REMOTE_RELEASE_BRANCH}") - UPSTREAM_CODE_BRANCH="release/${UPSTREAM_CODE_VERSION}" - echo "Checkouting latest release branch ${LATEST_RELEASE_BRANCH}" - git checkout ${LATEST_RELEASE_BRANCH} - git remote add upstream-code https://github.com/microsoft/vscode - echo "Fetch the branch ${UPSTREAM_CODE_BRANCH} from upstream-code" - git fetch upstream-code ${UPSTREAM_CODE_BRANCH} - - name: rebase - run: | - ./rebase.sh - - name: Validate tests on libc-ubi9 image - env: - # https://github.com/microsoft/vscode-ripgrep#github-api-limit-note - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - docker buildx build --memory-swap -1 --memory 10g --platform linux/amd64 -f build/dockerfiles/linux-libc-ubi9.Dockerfile . - - name: push changes - run: | - set -e - CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD) - git push origin ${CURRENT_BRANCH} - - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3701c05d987..750e6081838 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,6 +16,10 @@ on: description: 'The version that is going to be released. Should be in format 7.y.z' required: true default: '7.y.z' + mode: + description: 'Workflow mode. Use 'rebase' to only prepare release branch with rebase to stable version of vscode,'release' to perform release without preparing the branch, and 'all' to perform both rebase and release + required: true + default: '7.y.z' forceRecreateTags: description: If true, tags will be recreated. Use with caution required: false @@ -53,23 +57,27 @@ jobs: else echo "[INFO] No existing tags detected for $VERSION" fi + - name: "Prepare release branch" + if: {{ github.event.inputs.mode }} == all || {{ github.event.inputs.mode }} == rebase + run: | + VSCODE_VERSION=$(git describe --tags $(git rev-list --tags --max-count=1) ) + BRANCH=upstream-release/${VSCODE_VERSION%.*} + # TODO verify that branch is indeed following `1.[0-9]*.x` format + NEAREST_REBASE_COMMIT_SHA=$(git rev-list --author="Eclipse Che Sync" --max-count=1 HEAD) + COMMON_COMMIT_SHA$(git merge-base main $BRANCH) + git checkout ${NEAREST_REBASE_COMMIT_SHA} + # create release branch here + CHE_RELEASE_VERSION=${{ github.event.inputs.version }} + CHE_RELEASE_BRANCH=${CHE_RELEASE_VERSION%.*}.x + git checkout -b ${CHE_RELEASE_BRANCH} + # perform rebase to the closest commit + ./rebase.sh - name: "Tag release" + if: {{ github.event.inputs.mode }} == all || {{ github.event.inputs.mode }} == release run: | git config --global user.name "Mykhailo Kuznietsov" git config --global user.email "mkuznets@redhat.com" git config --global pull.rebase true export GITHUB_TOKEN=${{ secrets.CHE_INCUBATOR_BOT_TOKEN }} /bin/bash make-release.sh --version ${{ github.event.inputs.version }} --tag-release - #- name: Create failure MM message - #if: failure() - #run: | - #echo "{\"text\":\":no_entry_sign: Che Code ${{ env.BRANCH_NAME }} release has failed: https://github.com/che-incubator/che-code/actions/workflows/release.yml\"}" > mattermost.json - #- name: Send MM message - # only notify for failure, success message will be sent at the end of image-publish job - #if: failure() - #uses: mattermost/action-mattermost-notify@1.1.0 - #env: - #MATTERMOST_WEBHOOK_URL: ${{ secrets.MATTERMOST_WEBHOOK_URL }} - #MATTERMOST_CHANNEL: eclipse-che-releases - #MATTERMOST_USERNAME: che-bot