Skip to content

Commit

Permalink
Merge pull request #9 from alisaitteke/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
alisaitteke authored Nov 23, 2024
2 parents 5f95ad7 + c2cb105 commit 95c32f9
Show file tree
Hide file tree
Showing 6 changed files with 226 additions and 9 deletions.
30 changes: 30 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
- name: bug
color: d73a4a
description: Something isn't working
- name: documentation
color: 0075ca
description: Improvements or additions to documentation
- name: duplicate
color: cfd3d7
description: This issue or pull request already exists
- name: enhancement
color: a2eeef
description: New feature or request
- name: good first issue
color: 7057ff
description: Good for newcomers
- name: help wanted
color: 008672
description: Extra attention is needed
- name: invalid
color: e4e669
description: This doesn't seem right
- name: question
color: d876e3
description: Further information is requested
- name: wontfix
color: ffffff
description: This will not be worked on
- name: dependencies
color: 0366d6
description: Pull requests that update a dependency file
38 changes: 38 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
labels:
- 'chore'
- 'dependencies'

change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
change-title-escapes: '\<*_&'

version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch

template: |
## Changes
$CHANGES
**Full Changelog**: https://github.com/$OWNER/$REPOSITORY/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION
39 changes: 39 additions & 0 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Update Dependencies

on:
schedule:
- cron: '0 0 * * 1' # every Monday
workflow_dispatch: # Manuel trigger

jobs:
update-deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- name: Update dependencies
run: |
npm outdated
npm update
npm audit fix
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: 'chore(deps): update dependencies'
title: '⬆️ Update dependencies'
body: |
Automated dependency updates.
- Dependency updates
- Security patches
- npm audit fixes
branch: dependency-updates
base: master
20 changes: 20 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Sync Labels

on:
push:
branches: [ master ]
paths:
- '.github/labels.yml'
workflow_dispatch:

jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- uses: micnncim/action-label-syncer@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
manifest: .github/labels.yml
92 changes: 83 additions & 9 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
name: Node.js Package
name: NPM Package Publication
on:
release:
types: [created]

jobs:
checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'
- run: npm ci
- run: npm run typecheck
- run: npm run lint
- run: npm run build

publish-gpr:
needs: checks
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -15,13 +30,32 @@ jobs:
with:
node-version: 20
registry-url: https://npm.pkg.github.com
- run: npm install
- run: npm run build
- run: npm publish
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Config Git user
run: |
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Handle publish error
if: failure()
run: |
echo "::error::Failed to publish to GitHub Packages"
exit 1
publish-npm:
needs: publish-gpr
needs: [checks, publish-gpr]
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -33,8 +67,48 @@ jobs:
with:
node-version: 20
registry-url: https://registry.npmjs.org
- run: npm install
- run: npm run build
- run: npm publish --provenance --access public
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build package
run: npm run build

- name: Verify package contents
run: |
npm pack
tar -tzf *.tgz
- name: Publish to NPM
run: |
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc
npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Handle publish error
if: failure()
run: |
echo "::error::Failed to publish to NPM"
exit 1
- name: Cleanup
if: always()
run: rm -f .npmrc

notify:
needs: [publish-npm]
runs-on: ubuntu-latest
if: always()
steps:
- name: Notify success
if: success()
run: |
echo "Package published successfully to NPM and GitHub Packages!"
- name: Notify failure
if: failure()
run: |
echo "Failed to publish package!"
exit 1
16 changes: 16 additions & 0 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release Drafter
on:
push:
branches: [ master ]
pull_request:
types: [opened, reopened, synchronize]

jobs:
update_release_draft:
runs-on: ubuntu-latest
steps:
- uses: release-drafter/release-drafter@v5
with:
config-name: release-drafter.yml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit 95c32f9

Please sign in to comment.