-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Redesigned Github actions so PR's will have a required version check …
…action before it can be merged
- Loading branch information
Showing
4 changed files
with
100 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: Creating new tag & release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
tag_and_release: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cloning the repository repo... | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Creating a tag and a release | ||
run: | | ||
VERSION_FILE="nova/core/galaxy.yml" | ||
VERSION=$(cat $VERSION_FILE | grep "version:" | cut -d " " -f 2) | ||
TAG_NAME="v$VERSION" | ||
echo "LATEST_TAG=$TAG_NAME" >> $GITHUB_ENV | ||
# Tagging and pushing the change | ||
git tag $TAG_NAME | ||
git push origin $TAG_NAME | ||
# Creating temp changelog file | ||
git log --pretty=format:"- %s" $(git describe --tags --abbrev=0 HEAD^^)..HEAD > CHANGELOG.md | ||
- name: Releasing a new version... | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
tag: ${{ env.LATEST_TAG }} | ||
bodyFile: CHANGELOG.md |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
name: Comparing PR version with the latest version | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
version_check: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Cloning the repository pull request repo... | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
repository: ${{ github.event.pull_request.head.repo.full_name }} | ||
|
||
- name: Comparing PR version with main... | ||
run: | | ||
export C_RED="\x1b[91m" | ||
export C_GREEN="\x1b[92m" | ||
export C_YELLOW="\x1b[93m" | ||
export C_RST="\x1b[0m" | ||
VERSION_FILE="nova/core/galaxy.yml" | ||
REMOTE_VERSION_URL="${{ vars.PROJECT_VERSION_FILE_URL }}" | ||
PR_VERSION=$(cat $VERSION_FILE | grep "version:" | cut -d " " -f 2) | ||
CURRENT_VERSION=$(curl "$REMOTE_VERSION_URL" -s | grep "version:" | cut -d " " -f 2) | ||
echo -n -e "${C_YELLOW}" | ||
echo -e "Pull Request Version - $PR_VERSION" | ||
echo -e "Current Version - $CURRENT_VERSION" | ||
echo -n -e "${C_RST}" | ||
if [[ $(echo "$PR_VERSION" | tr -d '.') -le $(echo "$CURRENT_VERSION" | tr -d '.') ]]; then | ||
echo -n -e "${C_RED}" | ||
echo -e "Pull request version $PR_VERSION is <= than current version $CURRENT_VERSION." | ||
echo -e "Please update the version in $VERSION_FILE file." | ||
echo -n -e "${C_RST}" | ||
exit 1 | ||
else | ||
echo -n -e "${C_GREEN}" | ||
echo "Version has been updated moving on" | ||
echo -n -e "${C_RST}" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters