|
1 | 1 | # github-release-example |
2 | | -An example on how to integrate GitHub release and approval with Kosli |
| 2 | +An example of how an approval for release to a protected environment in GitHub can be |
| 3 | +logged as an attestation in Kosli. |
| 4 | + |
| 5 | +## How to demo |
| 6 | + |
| 7 | +### Build a new version of backend |
| 8 | +Make a branch for your change |
| 9 | +```shell |
| 10 | +git checkout -b backent-next-version |
| 11 | +``` |
| 12 | + |
| 13 | +Simulate that you have done a change to the backend by increasing the `counter` in |
| 14 | +```shell |
| 15 | +apps/backend/backend-content.txt |
| 16 | +``` |
| 17 | +Commit and push the change to GitHub. |
| 18 | +Create a Pullrequest and merge the change back to main. |
| 19 | + |
| 20 | +This will trigger a workflow in [GitHub](https://github.com/kosli-dev/github-release-example/actions/workflows/build-deploy-backend.yml) |
| 21 | + |
| 22 | +You now have to approve the deployment to `staging envirnment` |
| 23 | + |
| 24 | +You should now have a trail that matches the commit in the |
| 25 | +[github-release-example-backend](https://app.kosli.com/kosli-public/flows/github-release-example-backend/trails/) flow. |
| 26 | +The trail should have an `artifact` and a `pull-request` attestation. |
| 27 | + |
| 28 | + |
| 29 | +### Release of SW to production |
| 30 | +We now want to release the new version of the backend. |
| 31 | + |
| 32 | +Add and push a new version tag. |
| 33 | +```shell |
| 34 | +tag=v0.0.16 |
| 35 | +git tag -a $tag -m "Version $tag" |
| 36 | +git push origin $tag |
| 37 | +``` |
| 38 | + |
| 39 | +This will trigger the same workflow in [GitHub](https://github.com/kosli-dev/github-release-example/actions/workflows/build-deploy-backend.yml) |
| 40 | + |
| 41 | +The trail name will match the version tag. |
| 42 | + |
| 43 | +Approve the SW for staging first, and then for production. |
| 44 | + |
| 45 | +In the Kosli trail for the release you will now have a `release-approval` in addition to the pull-request and artifact. |
0 commit comments