diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 7170f4d..aa39efb 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -1,4 +1,4 @@ -name: mongotools-audit +name: audit on: schedule: @@ -38,7 +38,7 @@ jobs: echo "install" pnpm install echo "show outdated (if any)" - pnpm outdated --depth=3 || echo "you must think about update your dependencies :)" + pnpm outdated --depth=3 || echo "::notice title=OneLineReport::â„šī¸ you must think about update your dependencies :)" - name: pnpm audit run: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2fe09d9..f4be2a5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,5 +1,5 @@ # mongotools continuous integration -name: mongotools-ci +name: main # Controls when the action will run. on: diff --git a/.github/workflows/major.yml b/.github/workflows/major.yml index 6188256..cf4c20d 100644 --- a/.github/workflows/major.yml +++ b/.github/workflows/major.yml @@ -1,9 +1,12 @@ -# mongotools create minor from 'main' branch -name: mongotools-major +# mongotools create major from 'main' branch +name: major on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -12,6 +15,9 @@ jobs: node-version: [ 18.x ] steps: + - name: Check GitHub CLI + run: gh --version + - name: Checkout code uses: actions/checkout@v5 @@ -35,4 +41,21 @@ jobs: git checkout main pnpm version major git branch -f npmjs - git push origin main npmjs --tags \ No newline at end of file + git push -f origin main npmjs --tags + + - name: Create draft release + env: + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} + run: | + # Extract version from package.json + VERSION=$(node -p "require('./package.json').version") + + echo "🔖 Creating draft release for version v$VERSION" + + # Optionally check if release already exists + if gh release view "v$VERSION" > /dev/null 2>&1; then + echo "::warning title=â„šī¸ Release v$VERSION already exists, skipping." + else + gh release create "v$VERSION" --draft --generate-notes + echo "::notice title=✅ Draft release v$VERSION created." + fi \ No newline at end of file diff --git a/.github/workflows/minor.yml b/.github/workflows/minor.yml index 98b6313..34fb4e5 100644 --- a/.github/workflows/minor.yml +++ b/.github/workflows/minor.yml @@ -4,6 +4,9 @@ on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -12,6 +15,9 @@ jobs: node-version: [ 18.x ] steps: + - name: Check GitHub CLI + run: gh --version + - name: Checkout code uses: actions/checkout@v5 @@ -35,4 +41,21 @@ jobs: git checkout main pnpm version minor git branch -f npmjs - git push origin main npmjs --tags \ No newline at end of file + git push -f origin main npmjs --tags + + - name: Create draft release + env: + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} + run: | + # Extract version from package.json + VERSION=$(node -p "require('./package.json').version") + + echo "🔖 Creating draft release for version v$VERSION" + + # Optionally check if release already exists + if gh release view "v$VERSION" > /dev/null 2>&1; then + echo "::warning title=â„šī¸ Release v$VERSION already exists, skipping." + else + gh release create "v$VERSION" --draft --generate-notes + echo "::notice title=✅ Draft release v$VERSION created." + fi \ No newline at end of file diff --git a/.github/workflows/patch.yml b/.github/workflows/patch.yml index c3b0756..9c90320 100644 --- a/.github/workflows/patch.yml +++ b/.github/workflows/patch.yml @@ -1,9 +1,12 @@ # mongotools create patch from 'main' branch -name: mongotools-patch +name: patch on: # Allows you to run this workflow manually from the Actions tab workflow_dispatch: +permissions: + contents: write + jobs: build: runs-on: ubuntu-latest @@ -12,6 +15,9 @@ jobs: node-version: [ 18.x ] steps: + - name: Check GitHub CLI + run: gh --version + - name: Checkout code uses: actions/checkout@v5 @@ -35,4 +41,21 @@ jobs: git checkout main pnpm version patch git branch -f npmjs - git push origin main npmjs --tags \ No newline at end of file + git push -f origin main npmjs --tags + + - name: Create draft release + env: + GITHUB_TOKEN: ${{ secrets.GH_ACTIONS_TOKEN }} + run: | + # Extract version from package.json + VERSION=$(node -p "require('./package.json').version") + + echo "🔖 Creating draft release for version v$VERSION" + + # Optionally check if release already exists + if gh release view "v$VERSION" > /dev/null 2>&1; then + echo "::warning title=â„šī¸ Release v$VERSION already exists, skipping." + else + gh release create "v$VERSION" --draft --generate-notes + echo "::notice title=✅ Draft release v$VERSION created." + fi \ No newline at end of file