Skip to content
This repository was archived by the owner on Nov 10, 2022. It is now read-only.

Commit 6d80507

Browse files
authored
chore: add release-please github action (#112)
1 parent 5f45865 commit 6d80507

File tree

4 files changed

+38
-19
lines changed

4 files changed

+38
-19
lines changed

.github/workflows/release-please.yml

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
on:
2+
push:
3+
branches:
4+
- main
5+
name: release-please
6+
jobs:
7+
release-please:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: GoogleCloudPlatform/release-please-action@v2
11+
id: release
12+
with:
13+
token: ${{ secrets.GITHUB_TOKEN }}
14+
release-type: node
15+
package-name: "@opentelemetry/api"
16+
# The logic below handles the npm publication:
17+
- uses: actions/checkout@v2
18+
# these if statements ensure that a publication only occurs when
19+
# a new release is created:
20+
if: ${{ steps.release.outputs.release_created }}
21+
- uses: actions/setup-node@v1
22+
with:
23+
node-version: 14
24+
registry-url: 'https://registry.npmjs.org'
25+
if: ${{ steps.release.outputs.release_created }}
26+
- run: npm install
27+
if: ${{ steps.release.outputs.release_created }}
28+
- run: npm run compile
29+
if: ${{ steps.release.outputs.release_created }}
30+
- run: npm publish
31+
env:
32+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
33+
if: ${{ steps.release.outputs.release_created }}

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# version.ts file is autogenerated at compile time
2+
src/version.ts
3+
14
# Logs
25
logs
36
*.log

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@
1212
},
1313
"repository": "https://github.com/open-telemetry/opentelemetry-js-api.git",
1414
"scripts": {
15-
"build": "npm run compile",
1615
"clean": "tsc --build --clean tsconfig.json tsconfig.esm.json",
1716
"codecov:browser": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
1817
"codecov": "nyc report --reporter=json && codecov -f coverage/*.json -p .",
18+
"precompile": "npm run version",
1919
"compile": "tsc --build tsconfig.json tsconfig.esm.json",
2020
"docs": "typedoc",
2121
"docs:deploy": "gh-pages --dist docs/out",
@@ -25,6 +25,7 @@
2525
"test:browser": "nyc karma start --single-run",
2626
"test": "nyc ts-mocha -p tsconfig.json test/**/*.test.ts",
2727
"version": "node scripts/version-update.js",
28+
"prewatch": "npm run version",
2829
"watch": "tsc --build --watch"
2930
},
3031
"keywords": [

src/version.ts

-18
This file was deleted.

0 commit comments

Comments
 (0)