@@ -2,7 +2,7 @@ name: Build and Release
2
2
3
3
on :
4
4
push :
5
- branches : [ main ]
5
+ branches : [ main, fabisev/artifact-publishing ]
6
6
tags : [ 'v*', 'rc-*' ]
7
7
pull_request :
8
8
branches : [ main ]
47
47
48
48
- name : Generate checksums
49
49
run : |
50
- PACKAGE_FILE=$(ls aws-lambda-ric -*.tgz)
50
+ PACKAGE_FILE=$(ls icecream-shop -*.tgz)
51
51
sha256sum $PACKAGE_FILE > checksums.sha256
52
52
sha512sum $PACKAGE_FILE > checksums.sha512
53
53
cat checksums.sha256 checksums.sha512 > checksums.txt
58
58
with :
59
59
name : package-${{ steps.version.outputs.version }}
60
60
path : |
61
- aws-lambda-ric -*.tgz
61
+ icecream-shop -*.tgz
62
62
checksums.*
63
63
retention-days : 30
64
64
77
77
docker run --rm unit/nodejs.${{ matrix.node-version }}x
78
78
79
79
publish :
80
- if : startsWith(github.ref, 'refs/tags/')
80
+ if : startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/fabisev/artifact-publishing'
81
81
runs-on : codebuild-project-awsaws-lambda-nodejs-runtime-interface-client-${{ github.run_id }}-${{ github.run_attempt }}
82
82
needs : [build, test]
83
83
permissions :
@@ -98,37 +98,42 @@ jobs:
98
98
- name : Setup NPM authentication
99
99
run : |
100
100
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
102
103
103
104
- name : Determine version and package name
104
105
id : version
105
106
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
+ elif [[ "${{ github.ref }}" == refs/tags/rc-* ]]; then
107
112
RC_NUMBER=${GITHUB_REF#refs/tags/rc-}
108
113
PACKAGE_VERSION="${{ needs.build.outputs.version }}-rc.${RC_NUMBER}"
109
114
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
110
115
echo "is_rc=true" >> $GITHUB_OUTPUT
111
- npm version $PACKAGE_VERSION --no-git-tag-version
112
116
else
113
117
echo "package_version=${{ needs.build.outputs.version }}" >> $GITHUB_OUTPUT
114
- npm version ${{ needs.build.outputs.version }} --no-git-tag-version
115
118
fi
116
- npm pack
117
119
118
120
- name : Publish to npm
119
121
run : |
120
- if [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
121
- npm publish aws-lambda-ric-*.tgz --tag rc
122
+ PACKAGE_FILE=$(ls icecream-shop-*.tgz)
123
+ if [[ "${{ steps.version.outputs.is_test }}" == "true" ]]; then
124
+ npm publish $PACKAGE_FILE --tag test --access=public
125
+ elif [[ "${{ steps.version.outputs.is_rc }}" == "true" ]]; then
126
+ npm publish $PACKAGE_FILE --tag rc --access=public
122
127
else
123
- npm publish aws-lambda-ric-*.tgz
128
+ npm publish $PACKAGE_FILE --access=public
124
129
fi
125
130
126
131
- name : Create GitHub Release
127
132
if : startsWith(github.ref, 'refs/tags/')
128
133
uses : softprops/action-gh-release@v2
129
134
with :
130
135
files : |
131
- aws-lambda-ric -*.tgz
136
+ icecream-shop -*.tgz
132
137
checksums.sha256
133
138
checksums.sha512
134
139
checksums.txt
0 commit comments