10
10
11
11
jobs :
12
12
build :
13
- runs-on :
14
- - project-awsaws-lambda-nodejs-runtime-interface-client
13
+ runs-on : project-awsaws-lambda-nodejs-runtime-interface-client
15
14
timeout-minutes : 15
16
15
outputs :
17
16
version : ${{ steps.version.outputs.version }}
22
21
whoami
23
22
pwd
24
23
uname -a
25
- cat /etc/os-release || echo "No os-release file"
26
24
27
25
- uses : actions/checkout@v4
28
26
@@ -38,40 +36,15 @@ jobs:
38
36
BASE_VERSION=$(node -p "require('./package.json').version")
39
37
echo "version=$BASE_VERSION" >> $GITHUB_OUTPUT
40
38
41
- - name : Cache native dependencies
42
- uses : actions/cache@v4
43
- with :
44
- path : |
45
- deps/
46
- build/
47
- key : native-deps-${{ runner.os }}-${{ hashFiles('deps/versions', 'binding.gyp') }}
48
-
49
39
- name : Install build dependencies
50
- run : |
51
- echo "Installing build dependencies..."
52
- yum install -y cmake make gcc-c++
53
- echo "Build dependencies installed"
40
+ run : yum install -y cmake make gcc-c++
54
41
55
- - name : Clean build directories
56
- run : rm -rf deps/*/build
57
-
58
- - name : Install dependencies
59
- run : |
60
- echo "Starting npm ci..."
61
- npm ci --verbose
62
- echo "npm ci completed"
63
-
64
- - name : Build project
42
+ - name : Clean and build
65
43
run : |
66
- echo "Starting npm run build..."
44
+ rm -rf deps/*/build
45
+ npm ci
67
46
npm run build
68
- echo "Build completed"
69
-
70
- - name : Pack project
71
- run : |
72
- echo "Starting npm pack..."
73
47
npm pack
74
- echo "Pack completed"
75
48
76
49
- name : Generate checksums
77
50
run : |
91
64
retention-days : 30
92
65
93
66
test :
94
- runs-on :
95
- - project-awsaws-lambda-nodejs-runtime-interface-client
67
+ runs-on : project-awsaws-lambda-nodejs-runtime-interface-client
96
68
needs : [build]
97
69
strategy :
98
70
matrix :
107
79
108
80
publish :
109
81
if : startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/fabisev/artifact-publishing'
110
- runs-on :
111
- - project-awsaws-lambda-nodejs-runtime-interface-client
82
+ runs-on : project-awsaws-lambda-nodejs-runtime-interface-client
112
83
needs : [build, test]
113
84
permissions :
114
85
contents : write
@@ -120,11 +91,6 @@ jobs:
120
91
with :
121
92
name : package-${{ needs.build.outputs.version }}
122
93
123
- - name : Verify checksums
124
- run : |
125
- sha256sum -c checksums.sha256
126
- sha512sum -c checksums.sha512
127
-
128
94
- name : Setup Node.js
129
95
uses : actions/setup-node@v4
130
96
with :
@@ -139,25 +105,19 @@ jobs:
139
105
id : version
140
106
run : |
141
107
if [[ "${{ github.ref }}" == refs/heads/fabisev/artifact-publishing ]]; then
142
- # For branch testing, use a scoped package name and test version
143
108
PACKAGE_VERSION="${{ needs.build.outputs.version }}-test.$(date +%s)"
144
109
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
145
110
echo "is_test=true" >> $GITHUB_OUTPUT
146
- echo "is_rc=false" >> $GITHUB_OUTPUT
147
- # Change package name to avoid conflicts
148
111
npm pkg set name="avocado-toast"
149
112
npm version $PACKAGE_VERSION --no-git-tag-version
150
113
elif [[ "${{ github.ref }}" == refs/tags/rc-* ]]; then
151
114
RC_NUMBER=${GITHUB_REF#refs/tags/rc-}
152
115
PACKAGE_VERSION="${{ needs.build.outputs.version }}-rc.${RC_NUMBER}"
153
116
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
154
- echo "is_test=false" >> $GITHUB_OUTPUT
155
117
echo "is_rc=true" >> $GITHUB_OUTPUT
156
118
npm version $PACKAGE_VERSION --no-git-tag-version
157
119
else
158
120
echo "package_version=${{ needs.build.outputs.version }}" >> $GITHUB_OUTPUT
159
- echo "is_test=false" >> $GITHUB_OUTPUT
160
- echo "is_rc=false" >> $GITHUB_OUTPUT
161
121
fi
162
122
163
123
- name : Publish to npm
@@ -170,18 +130,6 @@ jobs:
170
130
npm publish aws-lambda-ric-*.tgz
171
131
fi
172
132
173
- - name : Generate and Update Changelog
174
- if : startsWith(github.ref, 'refs/tags/')
175
- run : |
176
- node scripts/generate-changelog.js --output release-notes.md
177
- node scripts/generate-changelog.js --update
178
- git config --local user.email "[email protected] "
179
- git config --local user.name "GitHub Action"
180
- git add RELEASE.CHANGELOG.md
181
- git commit -m "Update changelog for ${{ steps.version.outputs.package_version }}" || echo "No changes to commit"
182
- echo "Generated release notes:"
183
- cat release-notes.md
184
-
185
133
- name : Create GitHub Release
186
134
if : startsWith(github.ref, 'refs/tags/')
187
135
uses : softprops/action-gh-release@v2
@@ -192,5 +140,3 @@ jobs:
192
140
checksums.sha512
193
141
checksums.txt
194
142
prerelease : ${{ steps.version.outputs.is_rc }}
195
- name : ${{ steps.version.outputs.is_rc == 'true' && format('Release Candidate {0}', steps.version.outputs.package_version) || '' }}
196
- body_path : release-notes.md
0 commit comments