Skip to content

Commit

Permalink
Merge pull request #102 from baynezy/release/2.0.0.1
Browse files Browse the repository at this point in the history
Release version 2.0.0.1
  • Loading branch information
baynezy committed Apr 25, 2024
2 parents 756ab59 + 4e4a21a commit 2d6c519
Show file tree
Hide file tree
Showing 37 changed files with 842 additions and 140 deletions.
17 changes: 17 additions & 0 deletions .cm/gitstream.cm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# -*- mode: yaml -*-

manifest:
version: 1.0

automations:
estimated_time_to_review:
if:
- true
run:
- action: add-label@v1
args:
label: "{{ calc.etr }} min review"
color: {{ 'E94637' if (calc.etr >= 20) else ('FBBD10' if (calc.etr >= 5) else '36A853') }}

calc:
etr: {{ branch | estimatedReviewTime }}
11 changes: 10 additions & 1 deletion .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
- name: "breaking change"
color: "ff0205"
description: "This change will require a major version bump"
- name: "blocked"
color: "e11d21"
description: "This issue is blocked by another issue"
- name: "bug"
color: "d73a4a"
description: "Something isn't working"
Expand Down Expand Up @@ -30,4 +33,10 @@
description: "An issue describing some techinal debt that needs to be addressed in the future"
- name: "to do"
color: "fbca04"
description: "Work that is yet to be started"
description: "Work that is yet to be started"
- name: "awaiting feedback"
color: "fbca04"
description: "This issue is awaiting feedback from the reporter"
- name: "stale"
color: "eeeeee"
description: "This issue/PR has been inactive for too long"
36 changes: 36 additions & 0 deletions .github/workflows/blocked-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Blocked Issue Labeler

on:
issues:
types:
- opened
- edited
issue_comment:
types:
- created
- edited

jobs:
add-blocked-label:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Add blocked label if issue is blocked
run: |
body=$BODY
comment=$COMMENT
issue_number=${{ github.event.issue.number }}
# if body contains "blocked" or comment contains "blocked"
# add label "blocked"
if [[ "${body,,}" == *"blocked"* ]] || [[ "${comment,,}" == *"blocked"* ]]; then
echo "Issue is blocked"
echo "Adding blocked label"
gh issue edit $issue_number --add-label blocked
fi
env:
BODY: ${{ github.event.issue.body }}
COMMENT: ${{ github.event.comment.body }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/branch-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Deploy Develop Branch

on:
push:
branches:
- develop
paths:
- 'src/**'
- 'test/**'
- '**.sln'
- '**.cake'
- '.github/workflows/branch-develop.yml'
- '.github/workflows/step-*.yml'
workflow_dispatch:

jobs:
get-version:
uses: ./.github/workflows/step-version.yml

build:
needs: [get-version]
uses: ./.github/workflows/step-build.yml
secrets: inherit
with:
version: ${{ needs.get-version.outputs.version }}
checkout-ref: ${{ github.base_ref }}
31 changes: 31 additions & 0 deletions .github/workflows/branch-feature.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deploy Feature Branch

on:
pull_request:
types: [opened, synchronize]
branches:
- develop
paths:
- 'src/**'
- 'test/**'
- '**.sln'
- '**.cake'
- '.github/workflows/branch-feature.yml'
- '.github/workflows/step-*.yml'
workflow_dispatch:

jobs:
get-version:
if: startsWith(github.head_ref, 'feature/') || github.head_ref == 'master'
uses: ./.github/workflows/step-version.yml
secrets: inherit
with:
is-pre-release: true

build:
needs: [get-version]
uses: ./.github/workflows/step-build.yml
secrets: inherit
with:
version: ${{ needs.get-version.outputs.version }}
checkout-ref: ${{ github.head_ref }}
58 changes: 58 additions & 0 deletions .github/workflows/branch-hotfix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Deploy HotFix Branch

on:
pull_request:
types: [opened, synchronize]
branches:
- master
workflow_dispatch:

jobs:
get-version:
if: startsWith(github.head_ref, 'hotfix/')
uses: ./.github/workflows/step-version.yml

build:
needs: [get-version]
uses: ./.github/workflows/step-build.yml
secrets: inherit
with:
version: ${{ needs.get-version.outputs.version }}
checkout-ref: ${{ github.head_ref }}

update-metadata:
if: github.event.action == 'opened'
needs: [get-version]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Increment Version
id: increment_version
run: |
echo "patch_version=$(($(cat semver.json | jq -r '.patch')+1))" > $GITHUB_OUTPUT
- name: Store New Version
uses: RadovanPelka/github-action-json@v1.0.1
with:
path: semver.json
replaceWith: |
{
"major": "${{ needs.get-version.outputs.major }}",
"minor": "${{ needs.get-version.outputs.minor }}",
"patch": "${{ steps.increment_version.outputs.patch_version }}",
"build": "${{ github.run_number }}"
}
- name: Update changelog
uses: thomaseizinger/keep-a-changelog-new-release@1.3.0
with:
tag: ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}
- name: Commit Changes
run: |
git config --global user.name "GitHub Action Bot"
git config --global user.email "no-reply@after-life.co"
git add CHANGELOG.md semver.json
git commit --message "Bump Version to ${{ needs.get-version.outputs.major }}.${{ needs.get-version.outputs.minor }}.${{ steps.increment_version.outputs.patch_version }}.${{ github.run_number }}"
- name: Push Version
run: git push origin ${{ github.head_ref }}
53 changes: 53 additions & 0 deletions .github/workflows/branch-master.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Deploy Master Branch

on:
push:
branches:
- master
workflow_dispatch:

jobs:
get-version:
uses: ./.github/workflows/step-version.yml
with:
static-build: true

build:
needs: [get-version]
uses: ./.github/workflows/step-build.yml
secrets: inherit
with:
version: ${{ needs.get-version.outputs.version }}
checkout-ref: ${{ github.base_ref }}

publish-to-nuget:
needs: [get-version,build]
uses: ./.github/workflows/step-publish.yml
secrets: inherit
with:
deploy-env: nuget
deploy-branch: ${{ github.base_ref }}
version: ${{ needs.get-version.outputs.version }}

tag-release:
needs: [get-version,publish-to-nuget]
uses: ./.github/workflows/step-tag-release.yml
with:
version: ${{ needs.get-version.outputs.version }}

merge-master-to-develop:
needs: [publish-to-nuget]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.CREATE_PR_TOKEN }}
run: |
echo -e "This PR merges the master branch back into develop.\nThis happens to ensure that the updates that happened on the release branch, i.e. CHANGELOG updates are also present on the develop branch." > msg.txt
export msg=$(cat msg.txt) ; gh pr create \
--head master \
--base develop \
--title "Merge master into develop branch" \
--body "$msg"
29 changes: 29 additions & 0 deletions .github/workflows/branch-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Deploy Release Branch

on:
pull_request:
types: [opened, synchronize]
branches:
- master
- develop
paths:
- 'src/**'
- 'test/**'
- '**.sln'
- '**.cake'
- '.github/workflows/branch-release.yml'
- '.github/workflows/step-*.yml'
workflow_dispatch:

jobs:
get-version:
if: startsWith(github.head_ref, 'release/')
uses: ./.github/workflows/step-version.yml

build:
needs: [get-version]
uses: ./.github/workflows/step-build.yml
secrets: inherit
with:
version: ${{ needs.get-version.outputs.version }}
checkout-ref: ${{ github.head_ref }}
61 changes: 0 additions & 61 deletions .github/workflows/codacy.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/completed-feature-workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Completed Feature Workflow

on:
pull_request:
branches: [ develop ]
types: [closed]

jobs:
update-merged-issue-issues:
if: github.event.pull_request.merged_by != '' && github.actor != 'dependabot[bot]' && startsWith(github.head_ref, 'feature/issue-')
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Extract Issue Number
shell: bash
run: echo "##[set-output name=issue;]$(echo ${{ github.event.pull_request.head.ref }} | sed 's|[^0-9]||g')"
id: extract_issue
- name: Output Issue Number
run: echo "Issue Number- ${{ steps.extract_issue.outputs.issue }}"
- name: Update Labels
run: gh issue edit ${{ steps.extract_issue.outputs.issue }} --add-label "next release" --remove-label "in progress"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit 2d6c519

Please sign in to comment.