Skip to content

Commit e69a19d

Browse files
author
Fabiana Severin
committed
Fixing build on codebuild
1 parent eeecccb commit e69a19d

File tree

1 file changed

+7
-61
lines changed

1 file changed

+7
-61
lines changed

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

Lines changed: 7 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ on:
1010

1111
jobs:
1212
build:
13-
runs-on:
14-
- project-awsaws-lambda-nodejs-runtime-interface-client
13+
runs-on: project-awsaws-lambda-nodejs-runtime-interface-client
1514
timeout-minutes: 15
1615
outputs:
1716
version: ${{ steps.version.outputs.version }}
@@ -22,7 +21,6 @@ jobs:
2221
whoami
2322
pwd
2423
uname -a
25-
cat /etc/os-release || echo "No os-release file"
2624
2725
- uses: actions/checkout@v4
2826

@@ -38,40 +36,15 @@ jobs:
3836
BASE_VERSION=$(node -p "require('./package.json').version")
3937
echo "version=$BASE_VERSION" >> $GITHUB_OUTPUT
4038
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-
4939
- 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++
5441

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
6543
run: |
66-
echo "Starting npm run build..."
44+
rm -rf deps/*/build
45+
npm ci
6746
npm run build
68-
echo "Build completed"
69-
70-
- name: Pack project
71-
run: |
72-
echo "Starting npm pack..."
7347
npm pack
74-
echo "Pack completed"
7548
7649
- name: Generate checksums
7750
run: |
@@ -91,8 +64,7 @@ jobs:
9164
retention-days: 30
9265

9366
test:
94-
runs-on:
95-
- project-awsaws-lambda-nodejs-runtime-interface-client
67+
runs-on: project-awsaws-lambda-nodejs-runtime-interface-client
9668
needs: [build]
9769
strategy:
9870
matrix:
@@ -107,8 +79,7 @@ jobs:
10779
10880
publish:
10981
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
11283
needs: [build, test]
11384
permissions:
11485
contents: write
@@ -120,11 +91,6 @@ jobs:
12091
with:
12192
name: package-${{ needs.build.outputs.version }}
12293

123-
- name: Verify checksums
124-
run: |
125-
sha256sum -c checksums.sha256
126-
sha512sum -c checksums.sha512
127-
12894
- name: Setup Node.js
12995
uses: actions/setup-node@v4
13096
with:
@@ -139,25 +105,19 @@ jobs:
139105
id: version
140106
run: |
141107
if [[ "${{ github.ref }}" == refs/heads/fabisev/artifact-publishing ]]; then
142-
# For branch testing, use a scoped package name and test version
143108
PACKAGE_VERSION="${{ needs.build.outputs.version }}-test.$(date +%s)"
144109
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
145110
echo "is_test=true" >> $GITHUB_OUTPUT
146-
echo "is_rc=false" >> $GITHUB_OUTPUT
147-
# Change package name to avoid conflicts
148111
npm pkg set name="avocado-toast"
149112
npm version $PACKAGE_VERSION --no-git-tag-version
150113
elif [[ "${{ github.ref }}" == refs/tags/rc-* ]]; then
151114
RC_NUMBER=${GITHUB_REF#refs/tags/rc-}
152115
PACKAGE_VERSION="${{ needs.build.outputs.version }}-rc.${RC_NUMBER}"
153116
echo "package_version=$PACKAGE_VERSION" >> $GITHUB_OUTPUT
154-
echo "is_test=false" >> $GITHUB_OUTPUT
155117
echo "is_rc=true" >> $GITHUB_OUTPUT
156118
npm version $PACKAGE_VERSION --no-git-tag-version
157119
else
158120
echo "package_version=${{ needs.build.outputs.version }}" >> $GITHUB_OUTPUT
159-
echo "is_test=false" >> $GITHUB_OUTPUT
160-
echo "is_rc=false" >> $GITHUB_OUTPUT
161121
fi
162122
163123
- name: Publish to npm
@@ -170,18 +130,6 @@ jobs:
170130
npm publish aws-lambda-ric-*.tgz
171131
fi
172132
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-
185133
- name: Create GitHub Release
186134
if: startsWith(github.ref, 'refs/tags/')
187135
uses: softprops/action-gh-release@v2
@@ -192,5 +140,3 @@ jobs:
192140
checksums.sha512
193141
checksums.txt
194142
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

Comments
 (0)