Skip to content

Commit

Permalink
Update release to tag and publish to github
Browse files Browse the repository at this point in the history
  • Loading branch information
iwysiu committed Mar 27, 2024
1 parent 888e112 commit 3485cc8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ on:
- main

jobs:
publish:
npm-publish:
name: Publish to NPM & GitHub Package Registry
runs-on: ubuntu-latest
outputs:
new_version: ${{ steps.version_check.outputs.version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
Expand Down Expand Up @@ -59,3 +61,20 @@ jobs:
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: npm-publish
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Create Release Notes
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "v${{ needs.npm-publish.outputs.new_version }}",
generate_release_notes: true
});
4 changes: 1 addition & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,4 @@ Want to install this repo locally?

Ready to release a new version?

- create a pr and update the package.json with the new version, as well as the changelog to be how you'd like
- 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)
- a note we don't currently make tags/releases on github, but perhaps in the future we can do so
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.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@grafana/aws-sdk",
"version": "0.3.2",
"version": "0.3.3",
"description": "Common AWS features for grafana",
"main": "dist/index.js",
"module": "dist/esm/index.js",
Expand Down

0 comments on commit 3485cc8

Please sign in to comment.