Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/nodejs.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
name: Node CI
name: CI

on: [push, pull_request]

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -33,7 +36,7 @@ jobs:
cache: 'pnpm'

- name: Install dependencies
run: pnpm install
run: pnpm install --frozen-lockfile

- name: Build
run: pnpm build
Expand Down
94 changes: 0 additions & 94 deletions .github/workflows/npmpublish.yml

This file was deleted.

52 changes: 52 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish

on:
release:
types: [published]

permissions:
contents: read
id-token: write

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

- name: Install pnpm
uses: pnpm/action-setup@v4

- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
cache: 'pnpm'

- name: Install
run: pnpm install --frozen-lockfile

- name: Build SDK
run: pnpm --filter @imagekit/astro build

- name: Stage README and LICENSE into package
run: |
cp README.md imagekit-astro/README.md
cp LICENSE imagekit-astro/LICENSE

- name: NPM Publish
working-directory: imagekit-astro
run: |
npm whoami
VERSION=$(node -p "require('./package.json').version")
# Stable versions go to "latest", pre-release versions go to "beta"
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
NPM_TAG="latest"
else
NPM_TAG="beta"
fi
echo "Publishing $VERSION with $NPM_TAG tag."
npm publish --tag $NPM_TAG --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
CI: true
Loading
Loading