Skip to content

Commit 3485cc8

Browse files
committed
Update release to tag and publish to github
1 parent 888e112 commit 3485cc8

File tree

3 files changed

+22
-5
lines changed

3 files changed

+22
-5
lines changed

.github/workflows/publish-npm.yml

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ on:
55
- main
66

77
jobs:
8-
publish:
8+
npm-publish:
99
name: Publish to NPM & GitHub Package Registry
1010
runs-on: ubuntu-latest
11+
outputs:
12+
new_version: ${{ steps.version_check.outputs.version }}
1113
steps:
1214
- name: Checkout repository
1315
uses: actions/checkout@v2
@@ -59,3 +61,20 @@ jobs:
5961
run: npm publish
6062
env:
6163
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64+
create-github-release:
65+
name: Create GitHub Release
66+
runs-on: ubuntu-latest
67+
needs: npm-publish
68+
steps:
69+
- name: Checkout code
70+
uses: actions/checkout@v2
71+
72+
- name: Create Release Notes
73+
uses: actions/[email protected]
74+
with:
75+
github-token: ${{ secrets.GITHUB_TOKEN }}
76+
script: |
77+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
78+
tag_name: "v${{ needs.npm-publish.outputs.new_version }}",
79+
generate_release_notes: true
80+
});

CONTRIBUTING.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@ Want to install this repo locally?
1616

1717
Ready to release a new version?
1818

19-
- create a pr and update the package.json with the new version, as well as the changelog to be how you'd like
20-
- merge the pr, that's it! (the change in the version triggers a publish to npm via https://github.com/grafana/grafana-aws-sdk-react/blob/main/.github/workflows/publish-npm.yml)
21-
- a note we don't currently make tags/releases on github, but perhaps in the future we can do so
19+
To release a new version of the package, commit the updated "version" field into main, which will trigger the [Release action](https://github.com/grafana/grafana-aws-sdk-react/blob/main/.github/workflows/publish-npm.yml) which publishes to npm and creates a github release with release notes.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@grafana/aws-sdk",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Common AWS features for grafana",
55
"main": "dist/index.js",
66
"module": "dist/esm/index.js",

0 commit comments

Comments
 (0)