mirror of
https://codeberg.org/JasterV/imgphash.git
synced 2026-04-26 18:10:01 +00:00
update CI
This commit is contained in:
parent
44f011192d
commit
c2ac8e3cfa
2 changed files with 31 additions and 39 deletions
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
|
|
@ -1,6 +1,3 @@
|
||||||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
|
|
||||||
|
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
|
|
@ -13,19 +10,19 @@ jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [18.x, 20.x, 21.x, 25.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v6
|
- name: Checkout code
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
uses: actions/checkout@v6
|
||||||
uses: actions/setup-node@v4
|
|
||||||
|
- name: Setup Bun
|
||||||
|
uses: oven-sh/setup-bun@v2
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
# This will always pull the most recent stable version
|
||||||
cache: "npm"
|
bun-version: latest
|
||||||
- run: npm install
|
|
||||||
- run: npm ci
|
- name: Install dependencies
|
||||||
- run: npm run build --if-present
|
# --frozen-lockfile is the Bun equivalent of 'npm ci'
|
||||||
- run: npm test
|
run: bun install --frozen-lockfile
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: bun test
|
||||||
|
|
|
||||||
39
.github/workflows/npm-publish.yml
vendored
39
.github/workflows/npm-publish.yml
vendored
|
|
@ -1,34 +1,29 @@
|
||||||
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
name: Bun Package Release
|
||||||
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
|
|
||||||
|
|
||||||
name: Node.js Package
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [created]
|
types: [created]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
|
||||||
node-version: 25
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm test
|
|
||||||
|
|
||||||
publish-npm:
|
- name: Setup Bun
|
||||||
needs: build
|
uses: oven-sh/setup-bun@v2
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v6
|
|
||||||
- uses: actions/setup-node@v4
|
|
||||||
with:
|
with:
|
||||||
node-version: 25
|
bun-version: latest
|
||||||
registry-url: https://registry.npmjs.org/
|
|
||||||
- run: npm install
|
- name: Install dependencies
|
||||||
- run: npm ci
|
run: bun install --frozen-lockfile
|
||||||
- run: npm publish
|
|
||||||
|
- name: Run Tests
|
||||||
|
run: bun test
|
||||||
|
|
||||||
|
- name: Publish to NPM
|
||||||
|
# --access public is required for scoped packages (@your-org/pkg)
|
||||||
|
# --tolerate-republish prevents CI failure if the version already exists
|
||||||
|
run: bun publish --access public --tolerate-republish
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
NPM_CONFIG_TOKEN: ${{ secrets.npm_token }}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue