Skip to content

Commit

Permalink
chore: minor housekeeping ✨
Browse files Browse the repository at this point in the history
Signed-off-by: Vinayak Kulkarni <19776877+vinayakkulkarni@users.noreply.github.com>
  • Loading branch information
vinayakkulkarni committed Mar 20, 2024
1 parent 4128801 commit 4f4aa95
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
24 changes: 20 additions & 4 deletions .github/workflows/shipjs-trigger.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: 'Ship js trigger'
name: Ship js trigger

on:
pull_request:
types:
- closed

jobs:
build:
name: Release
publish-to-npm:
name: 'Publishing to NPM ✨'
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && startsWith(github.head_ref, 'releases/v')
steps:
Expand All @@ -28,9 +28,25 @@ jobs:
- name: Install dependencies 🚀
run: bun install --frozen-lockfile

- name: Trigger a release 🥳
- name: Trigger a release (NPM) 🥳
run: bunx shipjs trigger
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
SLACK_INCOMING_HOOK: ${{ secrets.SLACK_INCOMING_HOOK }}

publish-to-jsr:
name: 'Publishing to JSR ✨'
runs-on: ubuntu-latest
needs: publish-to-npm
permissions:
contents: read
id-token: write
steps:
- name: Checkout code 🛎
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
- name: Trigger a release (JSR) 🥳
run: npx jsr publish
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@jsr:registry=https://npm.jsr.io
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"files.eol": "\n",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
"source.fixAll": "explicit"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
Expand Down
6 changes: 6 additions & 0 deletions jsr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "@vinayakkulkarni/v-github-icon",
"version": "3.1.3",
"exports": "./dist/v-github-icon.js",
"include": ["./dist/**"]
}
15 changes: 15 additions & 0 deletions scripts/bump-jsr-version.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env node

const fs = require('fs');

// Read package.json and parse the version
const pkg = JSON.parse(fs.readFileSync('package.json').toString());

// Read jsr.json and parse it
const jsr = JSON.parse(fs.readFileSync('jsr.json').toString());

// Update the version property in jsr object
jsr.version = pkg.version;

// Write the updated jsr.json file
fs.writeFileSync('jsr.json', JSON.stringify(jsr, null, 2));
5 changes: 4 additions & 1 deletion ship.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
module.exports = {
installCommand: () => 'bun i',
publishCommand: () => 'npm publish --tag latest',
publishCommand: () => 'bun publish --tag latest',
beforeCommitChanges: ({ exec }) => {
exec('./scripts/bump-jsr-version.cjs');
},
};

0 comments on commit 4f4aa95

Please sign in to comment.