Skip to content

Commit c124311

Browse files
author
Fabiana Severin
committed
Changing npm publishing
1 parent 201b966 commit c124311

File tree

2 files changed

+20
-12
lines changed

2 files changed

+20
-12
lines changed

.github/workflows/build-and-release.yml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build and Release
22

33
on:
44
push:
5-
branches: [ main ]
5+
branches: [ main, fabisev/artifact-publishing ]
66
tags: [ 'v*', 'rc-*' ]
77
pull_request:
88
branches: [ main ]
@@ -47,7 +47,7 @@ jobs:
4747
4848
- name: Generate checksums
4949
run: |
50-
PACKAGE_FILE=$(ls aws-lambda-ric-*.tgz)
50+
PACKAGE_FILE=$(ls icecream-shop-*.tgz)
5151
sha256sum $PACKAGE_FILE > checksums.sha256
5252
sha512sum $PACKAGE_FILE > checksums.sha512
5353
cat checksums.sha256 checksums.sha512 > checksums.txt
@@ -58,7 +58,7 @@ jobs:
5858
with:
5959
name: package-${{ steps.version.outputs.version }}
6060
path: |
61-
aws-lambda-ric-*.tgz
61+
icecream-shop-*.tgz
6262
checksums.*
6363
retention-days: 30
6464

@@ -77,7 +77,7 @@ jobs:
7777
docker run --rm unit/nodejs.${{ matrix.node-version }}x
7878
7979
publish:
80-
if: startsWith(github.ref, 'refs/tags/')
80+
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/fabisev/artifact-publishing'
8181
runs-on: codebuild-project-awsaws-lambda-nodejs-runtime-interface-client-${{ github.run_id }}-${{ github.run_attempt }}
8282
needs: [build, test]
8383
permissions:
@@ -98,12 +98,18 @@ jobs:
9898
- name: Setup NPM authentication
9999
run: |
100100
NPM_TOKEN=$(aws secretsmanager get-secret-value --secret-id aws-lambda-runtimes/github/nodejs/npm-token --query SecretString --output text)
101-
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
101+
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > .npmrc
102+
chmod 0600 .npmrc
102103
103104
- name: Determine version and package name
104105
id: version
105106
run: |
106-
if [[ "${{ github.ref }}" == refs/tags/rc-* ]]; then
107+
if [[ "${{ github.ref }}" == "refs/heads/fabisev/artifact-publishing" ]]; then
108+
TEST_VERSION="${{ needs.build.outputs.version }}-test.${GITHUB_SHA:0:7}"
109+
echo "package_version=$TEST_VERSION" >> $GITHUB_OUTPUT
110+
echo "is_test=true" >> $GITHUB_OUTPUT
111+
npm version $TEST_VERSION --no-git-tag-version
112+
elif [[ "${{ github.ref }}" == refs/tags/rc-* ]]; then
107113
RC_NUMBER=${GITHUB_REF#refs/tags/rc-}
108114
PACKAGE_VERSION="${{ needs.build.outputs.version }}-rc.${RC_NUMBER}"
109115
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
@@ -117,18 +123,20 @@ jobs:
117123
118124
- name: Publish to npm
119125
run: |
120-
if [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
121-
npm publish aws-lambda-ric-*.tgz --tag rc
126+
if [[ "${{ steps.version.outputs.is_test }}" == "true" ]]; then
127+
npm publish icecream-shop-*.tgz --tag test --access=public
128+
elif [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
129+
npm publish icecream-shop-*.tgz --tag rc --access=public
122130
else
123-
npm publish aws-lambda-ric-*.tgz
131+
npm publish icecream-shop-*.tgz --access=public
124132
fi
125133
126134
- name: Create GitHub Release
127135
if: startsWith(github.ref, 'refs/tags/')
128136
uses: softprops/action-gh-release@v2
129137
with:
130138
files: |
131-
aws-lambda-ric-*.tgz
139+
icecream-shop-*.tgz
132140
checksums.sha256
133141
checksums.sha512
134142
checksums.txt

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "aws-lambda-ric",
2+
"name": "icecream-shop",
33
"version": "3.3.0",
44
"description": "AWS Lambda Runtime Interface Client for NodeJs",
55
"homepage": "https://github.com/aws/aws-lambda-nodejs-runtime-interface-client",
@@ -35,7 +35,7 @@
3535
"author": "AWS Lambda",
3636
"license": "Apache-2.0",
3737
"bin": {
38-
"aws-lambda-ric": "bin/index.mjs"
38+
"icecream-shop": "bin/index.mjs"
3939
},
4040
"husky": {
4141
"hooks": {

0 commit comments

Comments
 (0)