Update npm dependencies #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: auto-update | |
run-name: Update npm dependencies | |
on: | |
schedule: | |
- cron: '30 12 4,18 * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update-deps: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Bun.js | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Update npm dependencies | |
run: | | |
bun bump | |
bun update | |
bun run b | |
bun run test --if-present | |
- name: Commit and push changes | |
uses: EndBug/add-and-commit@v9 | |
with: | |
add: 'package*.json bun.lockb' | |
message: 'Bot: bun deps update' | |
- name: Store build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-artifacts | |
path: | | |
dist | |
package*.json | |
bun.lockb | |
publish-npm: | |
needs: update-deps | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Bun.js | |
uses: oven-sh/setup-bun@v2 | |
with: | |
bun-version: latest | |
- name: Download build artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
name: build-artifacts | |
- name: Prepare npm build | |
run: | | |
echo "//registry.npmjs.org/:_authToken=\${NODE_AUTH_TOKEN}" > .npmrc | |
sed -i 's!./src!./dist!g' ./package.json | |
bun i | |
- name: Publish to npmjs.com | |
run: bun publish | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |