Skip to content

Commit

Permalink
ci: fix cog configuration for GitHub
Browse files Browse the repository at this point in the history
  • Loading branch information
massix committed Jul 5, 2024
1 parent c54b8ce commit 97c7ec1
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 14 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: CI
on: [push]
name: Continuous Integration
on:
pull_request:
jobs:
build:
name: Build and Unit Tests
Expand Down
36 changes: 25 additions & 11 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
name: Deploy on DockerHub
name: Release
on:
push:
tags: ['v*']
branches:
- main
permissions:
contents: write
pull-requests: read
Expand All @@ -25,24 +26,37 @@ jobs:
docker tag "${IMAGE}:$(make image-tag)" "${IMAGE}:latest"
docker push "${IMAGE}:latest"
release:
name: Generate Changelog
name: Create Release
runs-on: ubuntu-latest
needs: deploy
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use cocogitto to generate CHANGELOG.md
with:
fetch-depth: 0
fetch-tags: true
- name: Install Cocogitto
uses: cocogitto/cocogitto-action@v3
with:
release: true
release: false
check: false
git-user: 'github-actions[bot]'
git-user-email: 'github-actions@github.com'
- name: Bump version
run: |
export TAG=""
export VERSION=""
VERSION="$(make image-tag)"
cog bump --version "${VERSION}"
cog changelog --at "v${VERSION}" > tmp.md
- name: Push back to repository
run: |
git config user.email "github-actions@github.com"
git config user.name "github-actions[bot]"
git push
- uses: softprops/action-gh-release@v2
with:
body_path: CHANGELOG.md
body_path: tmp.md
generate_release_notes: true
make_latest: "true"
draft: false
- name: Commit back report
run: |
git config user.email "github-actions@github.com"
git config user.name "github-actions[bot]"
git push
1 change: 0 additions & 1 deletion cog.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
tag_prefix = "v"
branch_whitelist = ["main"]
ignore_merge_commits = true
skip_ci = "[ci skip]"

0 comments on commit 97c7ec1

Please sign in to comment.