Skip to content

Commit 448f628

Browse files
committed
Fix NPM deployment script
Added documentation on how release work
1 parent b8d0dbe commit 448f628

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

.github/workflows/npm.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,22 +38,21 @@ jobs:
3838
- name: NPM Install
3939
run: npm ci
4040
- name: Build and Test
41-
run: npm run build && npm run package
42-
# - name: Release
43-
# if: startsWith(github.ref, 'refs/tags/v')
44-
# run: npm run release
45-
# - name: GitHub Release
46-
# if: startsWith(github.ref, 'refs/tags/v')
47-
# uses: ncipollo/release-action@v1
48-
# with:
49-
# artifacts: dist/layer.zip
50-
# token: ${{ secrets.GITHUB_TOKEN }}
41+
run: npm run build-and-test
42+
- name: Release
43+
if: startsWith(github.ref, 'refs/tags/v')
44+
run: npm run release
45+
- name: GitHub Release
46+
if: startsWith(github.ref, 'refs/tags/v')
47+
uses: ncipollo/release-action@v1
48+
with:
49+
artifacts: dist/layer.zip
50+
token: ${{ secrets.GITHUB_TOKEN }}
5151
- name: NPM Publish
5252
if: startsWith(github.ref, 'refs/tags/v')
5353
env:
5454
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
5555
run: |
56-
echo "$(git describe --tags --abbrev=0)"
5756
npm --no-git-tag-version version "$(git describe --tags --abbrev=0)"
5857
npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
5958
npm publish

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,12 @@ Other targets of interest
164164
- `prettier-fix` - Automatically fixes Prettier issues
165165
- `lint-fix` - Automatically fixes ESLint issues
166166

167+
## Releases
168+
169+
1. Push the latest change and wait for the build to pass
170+
1. Tag the latest commit with the version like so `git tag -a vX.Y.Z -m X.Y.Z` and push the tag
171+
1. The GitHub release should be created automatically as well as updating the NPM package.
172+
167173
## Debugging
168174

169175
If you see `ConfigError: Missing region in config` when running the integration test suite. You need to set the AWS region you are testing against in your environment variables. Running `AWS_REGION=us-east-1 npm run integration-test` should solve the problem.

0 commit comments

Comments
 (0)