Skip to content

Commit db2c222

Browse files
authored
Merge pull request #685 from pact-foundation/chore/upgrade-to-pact-ffi-0-4-28
fix: (rebuild) pact-ffi to 0.4.28
2 parents fb0d620 + f697570 commit db2c222

File tree

4 files changed

+22
-13
lines changed

4 files changed

+22
-13
lines changed

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,36 +64,36 @@ jobs:
6464

6565
steps:
6666
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
67-
if: github.ref == 'refs/heads/master'
67+
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
6868
with:
6969
fetch-depth: 0
7070

7171
- name: Use Node.js ${{ env.NODE_VERSION }}
7272
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
73-
if: github.ref == 'refs/heads/master'
73+
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
7474
with:
7575
node-version: ${{ env.NODE_VERSION }}
7676

77-
- if: ${{ runner.os == 'Windows' && github.ref == 'refs/heads/master'}}
77+
- if: ${{ runner.os == 'Windows' && ( github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
7878
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV
7979

80-
- if: ${{ matrix.docker == true && matrix.alpine == true && github.ref == 'refs/heads/master'}}
80+
- if: ${{ (matrix.docker == true && matrix.alpine == true) && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
8181
name: prebuild linux ${{ matrix.arch }} musl
8282
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20-alpine bin/sh -c 'apk add bash && cd /home && bash -c "/home/script/ci/prebuild-alpine.sh" && rm -rf ffi node_modules'
8383

84-
- if: ${{ matrix.docker == true && matrix.alpine != true && github.ref == 'refs/heads/master' }}
84+
- if: ${{ (matrix.docker == true && matrix.alpine != true )&& (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
8585
name: prebuild linux ${{ matrix.arch }}
8686
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20 bin/bash -c 'cd /home && /home/script/ci/prebuild.sh && rm -rf ffi node_modules'
8787

8888
- run: sudo chown -R $(id -u):$(id -g) prebuilds
89-
if: ${{ matrix.docker == true && github.ref == 'refs/heads/master' }}
89+
if: ${{ matrix.docker == true && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
9090

9191
- run: ./script/ci/prebuild.sh
92-
if: ${{ matrix.docker != true && github.ref == 'refs/heads/master'}}
92+
if: ${{ matrix.docker != true && (github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')) }}
9393

9494
- name: Upload prebuild for ${{ runner.os }}-${{ runner.arch }}
9595
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
96-
if: github.ref == 'refs/heads/master'
96+
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
9797
with:
9898
path: prebuilds/*.tar.gz
9999
name: artifact-${{ matrix.docker == true && matrix.alpine == true && 'linux-musl' || matrix.docker == true && matrix.alpine == false && 'linux' || matrix.os }}-${{ matrix.arch }}
@@ -159,10 +159,10 @@ jobs:
159159
fetch-depth: 0
160160

161161
- name: Download prebuilds
162-
if: github.ref == 'refs/heads/master'
162+
if: github.ref == 'refs/heads/master' || contains(github.event.pull_request.title, '(rebuild)')
163163
uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0 # v5.0.0
164164
- run: FETCH_ASSETS=true REPO=pact-foundation/pact-js-core ./script/ci/check-release-libs.sh --fetch-assets
165-
if: github.ref != 'refs/heads/master'
165+
if: ${{ github.ref != 'refs/heads/master' && !contains(github.event.pull_request.title, '(rebuild)')}}
166166
env:
167167
GITHUB_TOKEN: ${{ github.token }}
168168

DEVELOPER.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,15 @@ Publishing packages with `--dry-run` option removed.
129129
PUBLISH=true ./script/ci/build-opt-dependencies.sh publish
130130
```
131131

132+
### Generating new prebuilds in CI
133+
134+
For speed, CI runs use prebuilds from master for test runs. If you wish to force a rebuild of the ffi package because
135+
136+
- the ffi library has been updated
137+
- the ffi binding code has been updated
138+
139+
Raise a pull request and add `(rebuild)`, anywhere in the title'
140+
132141
### Linux x86_64 Task
133142

134143
#### Pre Reqs

script/create-pr-to-update-pact-ffi.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ cat src/ffi/index.ts | sed "s/export const PACT_FFI_VERSION.*/export const PACT_
1919
mv tmp-install src/ffi/index.ts
2020

2121
git add src/ffi/index.ts
22-
git commit -m "${TYPE}: update pact-ffi to ${FFI_VERSION}"
22+
git commit -m "${TYPE}: (rebuild) - update pact-ffi to ${FFI_VERSION}"
2323
git push --set-upstream origin ${BRANCH_NAME}
2424

25-
gh pr create --title "${TYPE}: update pact-ffi to ${FFI_VERSION}" --fill
25+
gh pr create --title "${TYPE}: (rebuild) - update pact-ffi to ${FFI_VERSION}" --fill
2626

2727
git checkout master

src/ffi/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import logger, { DEFAULT_LOG_LEVEL } from '../logger';
55
import { LogLevel } from '../logger/types';
66
import { Ffi, FfiLogLevelFilter } from './types';
77

8-
export const PACT_FFI_VERSION = '0.4.22';
8+
export const PACT_FFI_VERSION = '0.4.28';
99

1010
/**
1111
* Returns the library path which is located inside `node_modules`

0 commit comments

Comments
 (0)