diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml new file mode 100644 index 0000000..dab32c1 --- /dev/null +++ b/.github/workflows/conventional-commits.yml @@ -0,0 +1,23 @@ +name: Conventional Commits + +on: [push] + +jobs: + validate-commits: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install cocogitto + run: | + curl -L https://github.com/cocogitto/cocogitto/releases/latest/download/cocogitto-6.3.0-x86_64-unknown-linux-musl.tar.gz \ + | tar --strip-components=1 -xz -C /usr/local/bin x86_64-unknown-linux-musl/cog + + - name: Validate conventional commits + run: | + # Find merge base and check commits in PR only + MERGE_BASE=$(git merge-base origin/main HEAD) + cog check ${MERGE_BASE}..HEAD diff --git a/Argcfile.sh b/Argcfile.sh index 5f4c184..f4fef09 100755 --- a/Argcfile.sh +++ b/Argcfile.sh @@ -6,10 +6,11 @@ set -eu # Invoked via "cog bump -a" publish() { git push origin main --tags + rm -rf dist/ pip install --upgrade build twine python3 -m build twine upload dist/* - rm dist/* + rm -rf dist/ } if ! command -v argc >/dev/null; then diff --git a/cog.toml b/cog.toml index a650dd3..037afbd 100644 --- a/cog.toml +++ b/cog.toml @@ -24,6 +24,7 @@ cog verify --file "$1" """ [commit_types] +build = { changelog_title = "", omit_from_changelog = true } chore = { changelog_title = "", omit_from_changelog = true } docs = { changelog_title = "", omit_from_changelog = true }