Skip to content

Commit

Permalink
Merge pull request #1 from dmytro-ndp/che-21988
Browse files Browse the repository at this point in the history
Add release scripts for version 7.63.x
  • Loading branch information
dmytro-ndp authored Apr 10, 2023
2 parents 7178878 + b9a7475 commit d246cd5
Show file tree
Hide file tree
Showing 10 changed files with 290 additions and 173 deletions.
140 changes: 0 additions & 140 deletions .github/workflows/build.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/make-branch.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/next-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#
# 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: Configbump Next Build

on:
workflow_dispatch:
inputs:
push:
branches: [ main ]
jobs:
build-push:
runs-on: ubuntu-22.04
steps:
- name: Checkout configmump source code
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to quay.io
uses: docker/login-action@v2
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
- id: vars
shell: bash
run: |
echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Build and push both short SHA tag and next tag
uses: docker/build-push-action@v3
with:
file: build/dockerfiles/Dockerfile
platforms: linux/amd64,linux/ppc64le,linux/arm64
push: true
tags: |
quay.io/che-incubator/configbump:next
quay.io/che-incubator/configbump:${{ steps.vars.outputs.sha_short }}
91 changes: 91 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
#
# 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 Configbump

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@v3
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 quay.io
uses: docker/login-action@v2
with:
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}
registry: quay.io
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- 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
- name: Create failure MM message
if: ${{ failure() }}
run: |
echo "{\"text\":\":no_entry_sign: Che Configbump ${{ github.event.inputs.version }} release has failed: https://github.com/che-incubator/configbump/actions/workflows/release.yml\"}" > mattermost.json
- name: Create success MM message
run: |
echo "{\"text\":\":white_check_mark: Che Configbump ${{ github.event.inputs.version }} has been released: quay.io/che-incubator/configbump:${{ github.event.inputs.version }}\"}" > mattermost.json
- name: Send MM message
if: ${{ success() }} || ${{ 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ We originally wrote a prototype of this tool in Rust (https://github.com/metlos/

```
$ ./configbump --help
config-bump 0.1.0
config-bump 7.63.0-SNAPSHOT
Usage: configbump --dir DIR --labels LABELS [--namespace NAMESPACE]
Options:
Expand Down
3 changes: 3 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Eclipse Che Configbump release process

Use "Release Che Configbump" workflow for release, which can be triggered manually on GitHub page of the repository at Actions -> "Release Che Configbump" -> "Run workflow"
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7.63.0-SNAPSHOT
7 changes: 7 additions & 0 deletions build/dockerfiles/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Dockerfile Clarification

**Dockerfile** is the Eclipse Che build file, used in this repo to publish to [quay.io/che-incubator/configbump](https://quay.io/repository/che-incubator/configbump?tab=tags).

**rhel.Dockerfile** is the build file for the [Red Hat OpenShift Devspaces](https://github.com/redhat-developer/devspaces-images/tree/devspaces-3-rhel-8/devspaces-configbump) image, which can be run locally.

**brew.Dockerfile** is a variation on `rhel.Dockerfile` specifically for Red Hat builds, and cannot be run locally as is.
2 changes: 1 addition & 1 deletion cmd/configbump/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type opts struct {

// Version returns the version of the program
func (opts) Version() string {
return "config-bump 0.1.0"
return "config-bump 7.63.0-SNAPSHOT"
}

const controllerName = "config-bump"
Expand Down
Loading

0 comments on commit d246cd5

Please sign in to comment.