Skip to content

Commit 284b7df

Browse files
committed
begin npm setup
1 parent 4b448d9 commit 284b7df

File tree

3 files changed

+52
-2
lines changed

3 files changed

+52
-2
lines changed

Diff for: .github/workflows/release-please.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: release-please
2+
on:
3+
push:
4+
branches:
5+
- main
6+
workflow_dispatch:
7+
permissions:
8+
contents: write
9+
pull-requests: write
10+
jobs:
11+
release-please:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: google-github-actions/release-please-action@v3
15+
id: release
16+
with:
17+
command: manifest
18+
release-type: node
19+
package-name: highlightjs-apex
20+
# The logic below handles the npm publication:
21+
- name: Checkout Repository
22+
# these if statements ensure that a publication only occurs when
23+
# a new release is created:
24+
if: ${{ steps.release.outputs.releases_created }}
25+
uses: actions/checkout@v4
26+
- name: Setup Node
27+
uses: actions/setup-node@v4
28+
if: ${{ steps.release.outputs.releases_created }}
29+
with:
30+
node-version: 18
31+
registry-url: 'https://registry.npmjs.org'
32+
- name: Build Packages
33+
if: ${{ steps.release.outputs.releases_created }}
34+
run: |
35+
npm install
36+
npx lerna bootstrap
37+
38+
# Release Please has already incremented versions and published tags, so we just
39+
# need to publish all unpublished versions to NPM here
40+
# See: https://github.com/lerna/lerna/tree/main/commands/publish#bump-from-package
41+
- name: Publish to NPM
42+
if: ${{ steps.release.outputs.releases_created }}
43+
env:
44+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
45+
run: npx lerna publish from-package --no-push --no-private --yes

Diff for: .npmignore

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,7 @@
11
assets
2-
demo
2+
demo
3+
.github
4+
.vscode
5+
node_modules,
6+
.release-please-manifest.json
7+
release-please-config.json

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "highlightjs-apex",
3-
"version": "1.2.0",
3+
"version": "1.3.0-1",
44
"description": "Apex Language of Salesforce highlighting plugin for highlight.js",
55
"main": "src/languages/apex.js",
66
"scripts": {

0 commit comments

Comments
 (0)