Skip to content

Commit

Permalink
Merge pull request #186 from TogetherCrew/122-ci-only-allow-merge-to-…
Browse files Browse the repository at this point in the history
…main-if-packagejson-version-has-increased

122 ci only allow merge to main if packagejson version has increased
  • Loading branch information
Behzad-rabiei authored Jan 24, 2025
2 parents 3d93dc3 + f1be718 commit 7352edb
Show file tree
Hide file tree
Showing 12 changed files with 10,747 additions and 3,819 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/publish.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: Release

on:
push:
branches:
- main

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

jobs:
ci:
uses: TogetherCrew/operations/.github/workflows/ci.yml@main
secrets:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

release:
name: semantic-release
runs-on: ubuntu-latest

needs: [ci]

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'

- name: Install dependencies
run: npm ci

- name: semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}

run: npx semantic-release
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx --no-install commitlint --edit $1
1 change: 1 addition & 0 deletions .husky/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
git status
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npx lint - staged
2 changes: 2 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
npm test
npx lint-staged
27 changes: 27 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/changelog",
{
"changelogFile": "CHANGELOG.md"
}
],
"@semantic-release/npm",
"@semantic-release/github",
[
"@semantic-release/git",
{
"assets": [
"CHANGELOG.md",
"package.json"
],
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
}
]
]
}
3 changes: 3 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
}
Loading

0 comments on commit 7352edb

Please sign in to comment.