From e2be239914f85bd934393b973ee919e3c12bebe9 Mon Sep 17 00:00:00 2001 From: Dmytro Serdiuk Date: Fri, 18 Oct 2019 23:12:44 +0300 Subject: [PATCH] Define workflows for the project Before stashing changes, the documentation will be generated. After making a commit, the full CI flow will be triggered. After a release, either a pull request for brew formulae will be submitted or the instructions will be printed. Also, the `version` file is removed before running a CI task in order to prevent a failure of the version test. For unit tests, the file is not expected. But after the installation, the file will be in the project's directory. --- .gitignore | 1 + .workflows/amend-work-after | 1 + .workflows/amend-work-ahead | 1 + .workflows/release-work-after | 22 ++++++++++++++++++++++ .workflows/save-work-after | 2 ++ .workflows/save-work-ahead | 2 ++ README.md | 7 +++++++ workflows | 3 +++ 8 files changed, 39 insertions(+) create mode 120000 .workflows/amend-work-after create mode 120000 .workflows/amend-work-ahead create mode 100755 .workflows/release-work-after create mode 100755 .workflows/save-work-after create mode 100755 .workflows/save-work-ahead diff --git a/.gitignore b/.gitignore index 899561d..3452dd2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .idea/ tmp/ site/ +version diff --git a/.workflows/amend-work-after b/.workflows/amend-work-after new file mode 120000 index 0000000..6c966c7 --- /dev/null +++ b/.workflows/amend-work-after @@ -0,0 +1 @@ +save-work-after \ No newline at end of file diff --git a/.workflows/amend-work-ahead b/.workflows/amend-work-ahead new file mode 120000 index 0000000..403c5ca --- /dev/null +++ b/.workflows/amend-work-ahead @@ -0,0 +1 @@ +save-work-ahead \ No newline at end of file diff --git a/.workflows/release-work-after b/.workflows/release-work-after new file mode 100755 index 0000000..ce37a86 --- /dev/null +++ b/.workflows/release-work-after @@ -0,0 +1,22 @@ +#!/usr/bin/env bash +# add release notes +open https://github.com/bees-hive/elegant-git/releases/new +# update formulae +TAG=$(git describe) +COMMIT=$(git log --pretty=%H -1) + +if type brew >/dev/null 2>&1 ; then + info-text "Updating Homebrew formulae..." + brew bump-formula-pr --no-audit --tag=${TAG} --revision=${COMMIT} elegant-git +else + error-text "brew binary is not available." + error-text "Please make a manual formulae update." + cat <= 19.03.2 is used for running tests +- Python 3.x is needed for documentation previews +- Elegant Git automates testing process and documentation generation + ### Coding rules We enforce having a consistent implementation by following the next strict rules: - add `#!/usr/bin/env bash` at the beginning of each script diff --git a/workflows b/workflows index 017308c..019dbef 100755 --- a/workflows +++ b/workflows @@ -35,6 +35,9 @@ repository() { } ci() { + if [[ -f version ]]; then + rm -v version + fi docker run --rm -v $PWD:/eg ${WORKER_IMAGE} .workflows/ci-pipeline.bash testing }