Skip to content

Commit

Permalink
MM-59294: Workflow updated and release process (#7)
Browse files Browse the repository at this point in the history
* refactor: updated workflow and Readme

* chore: added Contributing and security.md

* refactor: updated README and makefile with new release process

* refactor: updated the protected branch name

* refactor: readme

* refactor: updated README

* refactor: removed focalboard references

* refactor: updated README
  • Loading branch information
Rajat-Dabade authored Jul 25, 2024
1 parent a407440 commit 4b4b0b2
Show file tree
Hide file tree
Showing 9 changed files with 267 additions and 161 deletions.
67 changes: 0 additions & 67 deletions .github/workflows/dev-release.yml

This file was deleted.

63 changes: 0 additions & 63 deletions .github/workflows/prod-release.yml

This file was deleted.

29 changes: 3 additions & 26 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,10 @@ pids
go.work
go.work.sum

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# node-waf configuration
.lock-wscript

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release
Expand All @@ -43,36 +35,21 @@ build/Release

# Dependency directory
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
node_modules
webapp/node_modules
webapp/dist
webapp/pack
dist
pack
package
bin
debug
__debug_bin
files
octo*.db
focalboard*.db
*.boardarchive
.eslintcache
.vscode/settings.json
# config.json is copied from app-config.json in the Makefile
mac/resources/config.json
mac/temp
mac/dist
mac/*.xcodeproj/**/xcuserdata
linux/bin
linux/dist
linux/temp
win/temp
win/dist
webapp/cypress/screenshots
webapp/cypress/videos
server/swagger/clients
server/vendor
.idea
docker/certs
docker/data
server/**/*.coverage
./dist
./vendor
File renamed without changes.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Disclaimer

> [!WARNING]
> **Effective September 15th, 2023, Mattermost, Inc. staff are no longer reviewing or merging pull requests for either Focalboard or the Mattermost Boards plugin in this repository (`mattermost/focalboard`). We encourage the community to fork this repository for continued development and contributions.**
>
> The reason behind these changes is to focus Mattermost developer resources on improving the platform’s performance and core features to ensure Mattermost continues being resilient, stable, and best-in-breed for critical operations.
>
> ️💡 [Learn more](https://forum.mattermost.com/t/upcoming-product-changes-to-boards-and-various-plugins/16669)
## Past maintainers

- **Scott Bishel**: [@sbishel](https://github.com/sbishel)
- **Jesús Espino**: [@jespino](https://github.com/jespino)
- **Doug Lauder**: [@wiggin77](https://github.com/wiggin77)
- **Miguel de la Cruz**: [@mgdelacroix](https://github.com/mgdelacroix)
- **Harshil Sharma**: [@harshilsharma63](https://github.com/harshilsharma63)
- **Chen Lim**: [@chenilim](https://github.com/chenilim)
- **Ogi Marušić**: [@ogi-m](https://github.com/ogi-m)
- **Winson Wu**: [@wuwinson](https://github.com/wuwinson)
- **Justine Geffen**: [@justinegeffen](https://github.com/justinegeffen)
107 changes: 107 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,110 @@ swagger: ## Generate swagger API spec and clients based on it.
cd server/swagger && openapi-generator generate -i swagger.yml -g typescript-fetch -o clients/typescript
cd server/swagger && openapi-generator generate -i swagger.yml -g swift5 -o clients/swift
cd server/swagger && openapi-generator generate -i swagger.yml -g python -o clients/python

# ====================================================================================
# Used for semver bumping
PROTECTED_BRANCH := main
APP_NAME := $(shell basename -s .git `git config --get remote.origin.url`)
CURRENT_VERSION := $(shell git describe --abbrev=0 --tags)
VERSION_PARTS := $(subst ., ,$(subst v,,$(subst -rc, ,$(CURRENT_VERSION))))
MAJOR := $(word 1,$(VERSION_PARTS))
MINOR := $(word 2,$(VERSION_PARTS))
PATCH := $(word 3,$(VERSION_PARTS))
RC := $(shell echo $(CURRENT_VERSION) | grep -oE 'rc[0-9]+' | sed 's/rc//')
# Check if current branch is protected
define check_protected_branch
@current_branch=$$(git rev-parse --abbrev-ref HEAD); \
if ! echo "$(PROTECTED_BRANCH)" | grep -wq "$$current_branch" && ! echo "$$current_branch" | grep -q "^release"; then \
echo "Error: Tagging is only allowed from $(PROTECTED_BRANCH) or release branches. You are on $$current_branch branch."; \
exit 1; \
fi
endef
# Check if there are pending pulls
define check_pending_pulls
@git fetch; \
current_branch=$$(git rev-parse --abbrev-ref HEAD); \
if [ "$$(git rev-parse HEAD)" != "$$(git rev-parse origin/$$current_branch)" ]; then \
echo "Error: Your branch is not up to date with upstream. Please pull the latest changes before performing a release"; \
exit 1; \
fi
endef
# Prompt for approval
define prompt_approval
@read -p "About to bump $(APP_NAME) to version $(1), approve? (y/n) " userinput; \
if [ "$$userinput" != "y" ]; then \
echo "Bump aborted."; \
exit 1; \
fi
endef
# ====================================================================================

.PHONY: patch minor major patch-rc minor-rc major-rc

patch: ## to bump patch version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
@$(eval PATCH := $(shell echo $$(($(PATCH)+1))))
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH))
@echo Bumping $(APP_NAME) to Patch version $(MAJOR).$(MINOR).$(PATCH)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH) -m "Bumping $(APP_NAME) to Patch version $(MAJOR).$(MINOR).$(PATCH)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)
@echo Bumped $(APP_NAME) to Patch version $(MAJOR).$(MINOR).$(PATCH)

minor: ## to bump minor version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
@$(eval MINOR := $(shell echo $$(($(MINOR)+1))))
@$(eval PATCH := 0)
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH))
@echo Bumping $(APP_NAME) to Minor version $(MAJOR).$(MINOR).$(PATCH)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH) -m "Bumping $(APP_NAME) to Minor version $(MAJOR).$(MINOR).$(PATCH)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)
@echo Bumped $(APP_NAME) to Minor version $(MAJOR).$(MINOR).$(PATCH)

major: ## to bump major version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
$(eval MAJOR := $(shell echo $$(($(MAJOR)+1))))
$(eval MINOR := 0)
$(eval PATCH := 0)
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH))
@echo Bumping $(APP_NAME) to Major version $(MAJOR).$(MINOR).$(PATCH)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH) -m "Bumping $(APP_NAME) to Major version $(MAJOR).$(MINOR).$(PATCH)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)
@echo Bumped $(APP_NAME) to Major version $(MAJOR).$(MINOR).$(PATCH)

patch-rc: ## to bump patch release candidate version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
@$(eval RC := $(shell echo $$(($(RC)+1))))
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH)-rc$(RC))
@echo Bumping $(APP_NAME) to Patch RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC) -m "Bumping $(APP_NAME) to Patch RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
@echo Bumped $(APP_NAME) to Patch RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)

minor-rc: ## to bump minor release candidate version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
@$(eval MINOR := $(shell echo $$(($(MINOR)+1))))
@$(eval PATCH := 0)
@$(eval RC := 1)
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH)-rc$(RC))
@echo Bumping $(APP_NAME) to Minor RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC) -m "Bumping $(APP_NAME) to Minor RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
@echo Bumped $(APP_NAME) to Minor RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)

major-rc: ## to bump major release candidate version (semver)
$(call check_protected_branch)
$(call check_pending_pulls)
@$(eval MAJOR := $(shell echo $$(($(MAJOR)+1))))
@$(eval MINOR := 0)
@$(eval PATCH := 0)
@$(eval RC := 1)
$(call prompt_approval,$(MAJOR).$(MINOR).$(PATCH)-rc$(RC))
@echo Bumping $(APP_NAME) to Major RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
git tag -s -a v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC) -m "Bumping $(APP_NAME) to Major RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)"
git push origin v$(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
@echo Bumped $(APP_NAME) to Major RC version $(MAJOR).$(MINOR).$(PATCH)-rc$(RC)
Loading

0 comments on commit 4b4b0b2

Please sign in to comment.