Skip to content

Commit fb40f63

Browse files
committed
Fix JS CI workflow setup
1 parent bcc19a1 commit fb40f63

1 file changed

Lines changed: 7 additions & 19 deletions

File tree

.github/workflows/nightly.yml

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ jobs:
189189

190190
- name: Setup js workspace
191191
run: |
192-
echo '{ "name": "SPeCS Workspace", "type": "module", "workspaces": [ "lara-framework/Lara-JS" ] }' > package.json
192+
echo '{ "name": "SPeCS Workspace", "type": "module", "workspaces": [ "lara-framework/Lara-JS" ], "overrides": { "node-gyp": "^12.1.0" } }' > package.json
193193
npm install
194194
195195
- name: Build Lara-JS
@@ -210,26 +210,14 @@ jobs:
210210
211211
# Only on ubuntu-latest
212212
- name: Publish JS
213-
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '25.x'
213+
if: github.event_name == 'push' && github.ref == 'refs/heads/staging' && matrix.os == 'ubuntu-latest' && matrix.node-version == '25.x'
214214
run: |
215215
cd lara-framework/Lara-JS
216216
npm whoami
217217
echo "Attempt to publish while running on ${{ matrix.os }} and Node.js ${{matrix.node-version}}"
218-
if [[ "${{ github.event_name }}" == "push" ]]; then
219-
if [ "${{ github.ref }}" == "refs/heads/staging" ]; then
220-
echo "Publishing from staging, creating timestamped prerelease and updating tag 'staging'"
221-
TIMESTAMP=$(date +"%Y%m%d%H%M")
222-
npm version prerelease --preid="$TIMESTAMP"
223-
npm publish --tag staging --access public
224-
# Not updating automatically the version since this would make the staging branch diverge from the main branch
225-
#elif [ "${{ github.ref }}" == "refs/heads/master" ]; then
226-
# echo "Publishing from main, assumes version was changed before publishing"
227-
# npm publish
228-
else
229-
echo "Not master or staging branches, not publishing even if it is a push event"
230-
fi
231-
else
232-
echo "Not a push event, skipping publish."
233-
fi
218+
echo "Publishing from staging, creating timestamped prerelease and updating tag 'staging'"
219+
TIMESTAMP=$(date +"%Y%m%d%H%M")
220+
npm version prerelease --preid="$TIMESTAMP"
221+
npm publish --tag staging --access public
234222
env:
235-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
223+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)