GitHub Workflow release Template
Template of github workflow with package deploying.
How to use:
- copy all files (5 items) to your github repository
- add release and devops branch
- add patch, minor, major labels
- configure workflow parameters in yml files
Workflows contain 4 yml files
- PR_to_master.yml - contain checks of pull requests to master branch
- Workflow parameters:
- on.pull_request.branches - main branch
- env.code_path - folder which contain code changes
- env.devops_path - folder which contain github workflows files
- env.release_branch - branch which agregate all changes before release
- env.devops_branch - branch which aggregate all changes of devops configuration
- env.project_path - path to csproj for version checks
- Jobs:
- check source of pull request to master branch - if changes contain files from code_path, they should come from release branch, if they contain files from devops_path, they should be from devops_branch
- check version of code package - if changes contain files from code_path, version of package must be equal to tag of latest draft release
v{packageVersion} == {draft.tag}
- Workflow parameters:
- PR_to_release.yml - contain checks of pull requests to release branch
- Workflow parameters:
- on.pull_request.branches - release branch
- env.code_path - folder which contain code changes
- Jobs:
- check label of code changes to release - all pull request to release branch which contain files from code_path, should have label: patch, minor, major
- Workflow parameters:
- push_to_master - contain release process of new version
- Workflow parameters:
- on.pull_request.branches - main branch
- on.push.paths - folder which contain code changes
- env.project_path - path to csproj for version checks
- Jobs:
- check version of code package - if changes contain files from code_path, version of package must be equal to tag of latest draft release
- build, push to github packages
- Workflow parameters:
- push_to_release - contain draft release process
- Workflow parameters:
- on.pull_request.branches - release branch
- Jobs:
- create/update draft release, when new code commited to the release branch
- Workflow parameters:
- release-drafter - config file of release factory
Additionally:
- add workflow "Check labels" required for release branch
- add workflows "Check head branch to master branch" and "If PR to master contain code changes: check version" required for master branch