Skip to content

Commit 0ec7a54

Browse files
chore: build profiling and production versions
1 parent 9e85ee2 commit 0ec7a54

File tree

2 files changed

+50
-6
lines changed

2 files changed

+50
-6
lines changed

.github/workflows/publish.yaml

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ jobs:
2020
strategy:
2121
matrix:
2222
os: [windows-latest, macos-latest]
23+
buildType: ['production', 'profiling']
2324
include:
2425
- os: macos-latest
2526
target: arm64
@@ -51,6 +52,10 @@ jobs:
5152
with:
5253
node-version-file: '.nvmrc'
5354

55+
- name: Update package.json
56+
if: ${{ matrix.buildType == 'profiling' }}
57+
run: pnpm version prerelease --no-git-tag-version --preid profiling
58+
5459
- name: Install node_modules
5560
run: pnpm install --frozen-lockfile
5661

@@ -68,27 +73,55 @@ jobs:
6873
- name: Upload artifacts
6974
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
7075
with:
71-
name: sqlcipher-${{matrix.os}}
76+
name: sqlcipher-${{matrix.buildType}}-${{matrix.os}}
7277
path: prebuilds/*
7378

7479
prebuild_linux:
7580
runs-on: ubuntu-latest
7681
timeout-minutes: 30
7782

83+
strategy:
84+
matrix:
85+
buildType: ['production', 'profiling']
86+
7887
steps:
7988
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
89+
90+
- name: Setup pnpm
91+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
92+
with:
93+
version: 10.3.0
94+
95+
- name: Get Node version from .nvmrc
96+
id: get-nvm-version
97+
shell: bash
98+
run: echo "node-version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
99+
100+
- name: Setup node.js
101+
uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a # v4.2.0
102+
with:
103+
node-version-file: '.nvmrc'
104+
105+
- name: Update package.json
106+
if: ${{ matrix.buildType == 'profiling' }}
107+
run: pnpm version prerelease --no-git-tag-version --preid profiling
108+
80109
- name: Build in docker container
81110
run: ./docker-prebuildify.sh
82111

83112
- name: Upload artifacts
84113
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
85114
with:
86-
name: sqlcipher-linux-latest
115+
name: sqlcipher-${{matrix.buildType}}-linux-latest
87116
path: prebuilds/*
88117

89118
publish:
90119
name: Publish
91120

121+
strategy:
122+
matrix:
123+
buildType: ['production', 'profiling']
124+
92125
permissions:
93126
# Needed for ncipollo/release-action.
94127
contents: 'write'
@@ -116,10 +149,14 @@ jobs:
116149
- name: Download built libraries
117150
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.19.1
118151
with:
119-
pattern: sqlcipher-*
152+
pattern: sqlcipher-${{matrix.buildType}}-*
120153
path: prebuilds
121154
merge-multiple: true
122155

156+
- name: Update package.json
157+
if: ${{ matrix.buildType == 'profiling' }}
158+
run: pnpm version prerelease --no-git-tag-version --preid profiling
159+
123160
- name: Install node_modules
124161
run: pnpm install --frozen-lockfile
125162

@@ -133,11 +170,18 @@ jobs:
133170
env:
134171
PREBUILDS_ONLY: 1
135172

136-
- name: Publish
173+
- name: Publish production
174+
if: ${{ matrix.buildType == 'production' }}
137175
run: pnpm publish --tag '${{ github.event.inputs.npm_tag }}' --access public --no-git-checks ${{ inputs.dry_run && '--dry-run' || ''}}
138176
env:
139177
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
140178

179+
- name: Publish profiling
180+
if: ${{ matrix.buildType == 'profiling' }}
181+
run: pnpm publish --tag 'profiling' --access public --no-git-checks ${{ inputs.dry_run && '--dry-run' || ''}}
182+
env:
183+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
184+
141185
- name: Rename symbols
142186
run: |
143187
mv prebuilds/darwin-arm64/node_sqlcipher.sym prebuilds/node_sqlcipher_darwin_arm64.sym
@@ -150,7 +194,7 @@ jobs:
150194
# This step is expected to fail if not run on a tag.
151195
- name: Upload debug info to release
152196
uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
153-
if: ${{ !inputs.dry_run }}
197+
if: ${{ !inputs.dry_run && matrix.buildType == 'production' }}
154198
with:
155199
allowUpdates: true
156200
artifactErrorsFailBuild: true

deps/sqlcipher/sqlcipher.gyp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
}],
100100

101101
# Profiling
102-
["\"<!(node -p \"require('../../package.json').version\")\".endswith(\"-profiling\")", {
102+
["\"-profiling\.\" in \"<!(node -p \"require('../../package.json').version\")\"", {
103103
'defines': [
104104
'SQLITE_ENABLE_STMT_SCANSTATUS'
105105
],

0 commit comments

Comments
 (0)