Skip to content

Commit

Permalink
Add: new better gh actions pipelines
Browse files Browse the repository at this point in the history
  • Loading branch information
NobleMajo committed Dec 5, 2024
1 parent fbfc047 commit ac5d77c
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 24 deletions.
66 changes: 66 additions & 0 deletions .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: auto-update
run-name: Update npm dependencies

on:
schedule:
- cron: '30 12 6,20 * *'
workflow_dispatch:

permissions:
contents: write

jobs:
update-deps:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'

- name: Update npm dependencies
run: |
npm version patch --no-git-tag-version
npm update
npm run build
npm run test --if-present
- name: Commit and push changes
uses: EndBug/add-and-commit@v9
with:
add: 'package*.json'
message: 'Bot: npm deps update'

- name: Update npm dependencies
run: |
npm version patch --no-git-tag-version
npm update
npm run build
npm run test --if-present
- uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist

publish-npm:
needs: update-deps
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- uses: actions/download-artifact@v4
with:
name: build-artifacts
path: dist
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 42 additions & 0 deletions .github/workflows/first-interaction-greetings.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: first-interaction-greetings
run-name: First interaction greetings

on: [pull_request_target, issues]

jobs:
greeting:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- name: First interaction greetings
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
👋 Hello!
Welcome to the repository, and thank you for opening an issue. 🎉 We're excited to have you contribute! Please make sure to include all the relevant details to help us understand your report or suggestion.
If you’re new here, take a moment to review our [contribution guidelines](./CONTRIBUTING.md) and [code of conduct](./CODE_OF_CONDUCT.md). These documents will help you collaborate effectively and ensure a positive experience for everyone.
We're here to help—feel free to reach out if you have any questions. 🚀
Thank you, and happy coding! 💻
pr-message: |
👋 Hi!
Welcome, and thank you for opening your first pull request with us! 🎉 We're thrilled to see your contribution.
Before we review, please ensure that:
- You've followed the [contribution guidelines](./CONTRIBUTING.md).
- Your changes are thoroughly tested and documented (if applicable).
- The PR description includes all necessary details for the reviewers.
Our team will review your submission as soon as possible. In the meantime, feel free to ask any questions or provide additional context to help with the review process.
We appreciate your effort and look forward to collaborating with you! 🚀
Cheers,
The Team ❤️
28 changes: 4 additions & 24 deletions .github/workflows/npm-publish.yml
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: NPM Publish
name: npm-publish
run-name: NPM build, test and publish

on:
workflow_dispatch:
push:
branches: [ "main" ]
paths:
Expand All @@ -22,35 +24,13 @@ jobs:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- run: npm ci
- run: npm run build --if-present
- run: npm run build
- run: npm run test --if-present
- uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist

# publish-gpr:
# needs: build
# runs-on: ubuntu-latest
# permissions:
# contents: read
# packages: write
# steps:
# - uses: actions/checkout@v4
# - uses: actions/setup-node@v3
# with:
# node-version: 20
# - uses: actions/download-artifact@v4
# with:
# name: build-artifacts
# path: dist
# - run: |
# npm config set registry "https://npm.pkg.github.com/"
# npm config set scope "@${{ github.repository_owner }}"
# npm publish
# env:
# NODE_AUTH_TOKEN: ${{ github.token }}

publish-npm:
needs: build
runs-on: ubuntu-latest
Expand Down

0 comments on commit ac5d77c

Please sign in to comment.