Skip to content
Merged
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
60 changes: 60 additions & 0 deletions .github/workflows/publish-api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Publish Workers API

on:
workflow_dispatch:
push:
branches:
- main
paths:
- 'api/**'

permissions:
contents: read

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org/'

- name: Create npmrc
working-directory: ./api
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_EMAIL: npm@jfrog.com
run: |
echo "Creating npmrc for publish"
cat > .npmrc << EOF
always-auth=true
email=${NPM_EMAIL}
registry=https://registry.npmjs.org/
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
EOF
cat .npmrc
echo "Creating npmrc done"

- name: Install dependencies
working-directory: ./api
run: npm install --no-progress

- name: Update minor version
working-directory: ./api
run: npm version minor --no-git-tag-version

- name: Build
working-directory: ./api
run: npm run build

- name: Publish to npm
working-directory: ./api
run: |
echo "Publishing API npm package"
npm publish
echo "Publishing API npm package done"
2 changes: 1 addition & 1 deletion api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jfrog-workers",
"version": "0.9.0",
"version": "0.8.0",
"description": "JFrog workers interfaces",
"homepage": "https://github.com/jfrog/workers-sample",
"contributors": [
Expand Down