Skip to content

Commit da6d858

Browse files
authored
Merge pull request #4 from grafana/elliot/gh-actions
drone -> github actions
2 parents d7dadfa + 41774d5 commit da6d858

File tree

3 files changed

+53
-51
lines changed

3 files changed

+53
-51
lines changed

.drone/README.md

-10
This file was deleted.

.drone/drone.yml

-41
This file was deleted.

.github/workflows/publish-npm.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: publish-npm
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
publish:
9+
name: Publish to NPM
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
with:
15+
ref: main
16+
17+
# limit releases to version changes - https://github.com/EndBug/version-check
18+
- name: Check version changes
19+
uses: EndBug/version-check@v1
20+
id: version_check
21+
with:
22+
# diff the commits rather than commit message for version changes
23+
diff-search: true
24+
25+
- name: Version update detected
26+
if: steps.version_check.outputs.changed == 'true'
27+
run: 'echo "Version change found! New version: ${{ steps.version_check.outputs.version }} (${{ steps.version_check.outputs.type }})"'
28+
29+
- name: Setup .npmrc file for NPM registry
30+
if: steps.version_check.outputs.changed == 'true'
31+
uses: actions/setup-node@v3
32+
with:
33+
node-version: 16.x
34+
registry-url: "https://registry.npmjs.org"
35+
36+
- name: Install dependencies
37+
uses: borales/actions-yarn@v4
38+
with:
39+
cmd: install
40+
41+
- name: Build production bundle
42+
uses: borales/actions-yarn@v4
43+
with:
44+
cmd: build
45+
46+
- name: Publish package to NPM
47+
if: steps.version_check.outputs.changed == 'true'
48+
run: |
49+
git fetch --tags
50+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
51+
yarn run publish from-git --yes --no-verify-access
52+
env:
53+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)