diff --git a/.github/workflows/gh_actions_pr.yaml b/.github/workflows/gh_actions_pr.yaml index d8a32844..75e6b8c0 100644 --- a/.github/workflows/gh_actions_pr.yaml +++ b/.github/workflows/gh_actions_pr.yaml @@ -28,4 +28,6 @@ jobs: with: file: build/dockerfiles/Dockerfile platforms: linux/amd64,linux/arm64 - push: false + push: true + tags: quay.io/eclipse/che-machine-exec:pr-check + diff --git a/.github/workflows/next-build.yaml b/.github/workflows/next-build.yaml new file mode 100644 index 00000000..dd473674 --- /dev/null +++ b/.github/workflows/next-build.yaml @@ -0,0 +1,48 @@ +# +# Copyright (c) 2019-2021 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 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Machine Exec Next Build + +on: + workflow_dispatch: + inputs: + push: + branches: [ main ] +jobs: + build-push: + runs-on: ubuntu-22.04 + steps: + - name: Checkout che-machine-exec source code + uses: actions/checkout@v6 + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + - name: Login to quay.io + uses: docker/login-action@v4 + with: + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + registry: quay.io + - id: vars + shell: bash + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: Build and push both short SHA tag and next tag + uses: docker/build-push-action@v7 + with: + file: build/dockerfiles/Dockerfile + platforms: linux/amd64,linux/arm64 + push: true + tags: | + quay.io/eclipse/che-machine-exec:next + quay.io/eclipse/che-machine-exec:${{ steps.vars.outputs.sha_short }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..99345ca5 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,83 @@ +# +# Copyright (c) 2019-2023 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 +# +# Contributors: +# Red Hat, Inc. - initial API and implementation +# + +name: Release Che Machine Exec + +on: + workflow_dispatch: + # Inputs the workflow accepts. + inputs: + version: + description: 'The version that is going to be released. Should be in format 7.y.z' + required: true + noCommit: + description: 'If true, will not commit the version bump changes' + default: '' + forceRecreateTags: + description: If true, tags will be recreated. Use with caution + required: false + default: 'false' +jobs: + build: + name: Create Release + runs-on: ubuntu-22.04 + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + fetch-depth: 0 + - name: Check existing tags + run: | + set +e + RECREATE_TAGS=${{ github.event.inputs.forceRecreateTags }} + VERSION=${{ github.event.inputs.version }} + EXISTING_TAG=$(git ls-remote --exit-code origin refs/tags/${VERSION}) + if [[ -n ${EXISTING_TAG} ]]; then + if [[ ${RECREATE_TAGS} == "true" ]]; then + echo "[INFO] Removing tag for ${VERSION} version. New tag will be recreated during release." + git push origin :$VERSION + else + echo "[ERROR] Cannot proceed with release - tag ${EXISTING_TAG} already exists." + exit 1 + fi + else + echo "[INFO] No existing tags detected for $VERSION" + fi + - name: Login to docker.io + uses: docker/login-action@v4 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_PASSWORD }} + registry: docker.io + - name: Login to quay.io + uses: docker/login-action@v4 + with: + username: ${{ secrets.QUAY_USERNAME }} + password: ${{ secrets.QUAY_PASSWORD }} + registry: quay.io + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + - name: Create 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_BOT_GITHUB_TOKEN }} + NO_COMMIT=${{ github.event.inputs.noCommit}} + if [[ $NO_COMMIT == "true" ]]; then + NO_COMMIT="--no-commit" + else + NO_COMMIT= + fi + /bin/bash make-release.sh --version ${{ github.event.inputs.version }} --trigger-release $NO_COMMIT diff --git a/build/dockerfiles/rhel.Dockerfile b/build/dockerfiles/rhel.Dockerfile index 73abe4ce..933c185f 100644 --- a/build/dockerfiles/rhel.Dockerfile +++ b/build/dockerfiles/rhel.Dockerfile @@ -10,7 +10,7 @@ # # https://registry.access.redhat.com/ubi8/go-toolset -FROM registry.access.redhat.com/ubi8/go-toolset:1.20.10-10 as builder +FROM registry.access.redhat.com/ubi8/go-toolset:1.26.5-1784141349 as builder ENV GOPATH=/go/ \ CGO_ENABLED=1 USER root