@krx3d/tizentube2 1.14.870 → 1.15.280

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
+ <profiles active="TizenTubeStandalone" version="3.1">
3
+ <profile name="TizenTubeStandalone">
4
+ <profileitem
5
+ ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/developer/tizen-developer-ca.cer"
6
+ distributor="0"
7
+ key="$GITHUB_WORKSPACE/tizen-data/keystore/author/author.p12"
8
+ password="$KEY_PW"
9
+ rootca=""/>
10
+ <profileitem
11
+ ca="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-public/tizen-distributor-ca.cer"
12
+ distributor="1"
13
+ key="$GITHUB_WORKSPACE/tizen-studio/tools/certificate-generator/certificates/distributor/sdk-public/tizen-distributor-signer.p12"
14
+ password="tizenpkcs12passfordsigner"
15
+ rootca=""/>
16
+ <profileitem ca="" distributor="2" key="" password="" rootca=""/>
17
+ </profile>
18
+ </profiles>
@@ -96,7 +96,7 @@
96
96
  # CONFIGURATION
97
97
  # -------------
98
98
  # - PACKAGE_NAME: Set to your npm package name (e.g., '@krx3d/tizentube')
99
- # - NODE_VERSION: Node.js version to use (default: '20')
99
+ # - NODE_VERSION: Node.js version to use (default: '24', Active LTS)
100
100
  # - UNPUBLISH_WINDOW_HOURS: How long versions can be unpublished (default: '72')
101
101
  #
102
102
  # -----------------------------------------------------------------------------
@@ -117,6 +117,7 @@ on:
117
117
  - '.gitignore'
118
118
  - '.npmignore'
119
119
  - 'LICENSE'
120
+ - 'AGENTS.md'
120
121
  - 'README.md'
121
122
  - 'package.json'
122
123
  - 'tizen.log'
@@ -124,6 +125,16 @@ on:
124
125
  - 'scripts/**'
125
126
  workflow_dispatch:
126
127
 
128
+ # Serialize runs so two pushes to main in quick succession can't both read
129
+ # package.json's version before either has committed its own bump — that
130
+ # race produces two runs computing the same "+10" version and the second
131
+ # npm publish failing with "Cannot publish over previously published
132
+ # version". Queue rather than cancel: a bump/publish already in progress
133
+ # must finish (and land its commit) before the next one reads the version.
134
+ concurrency:
135
+ group: ${{ github.workflow }}
136
+ cancel-in-progress: false
137
+
127
138
  # Allow this workflow to push back changes to the repo
128
139
  permissions:
129
140
  contents: write
@@ -131,7 +142,7 @@ permissions:
131
142
  env:
132
143
  PACKAGE_NAME: '@krx3d/tizentube2'
133
144
  PACKAGE_NAME_GH: 'KrX3D/TizenTube'
134
- NODE_VERSION: '20'
145
+ NODE_VERSION: '24'
135
146
  UNPUBLISH_WINDOW_HOURS: '72'
136
147
 
137
148
  jobs:
@@ -0,0 +1,298 @@
1
+ # -----------------------------------------------------------------------------
2
+ # Build and release the TizenTube Standalone app (standalone/)
3
+ #
4
+ # WHAT THIS DOES
5
+ # ---------------
6
+ # Builds the userscript + regular DIAL service (needed by the standalone
7
+ # service), then the standalone service itself, then packages and signs
8
+ # standalone/ into a .wgt using Samsung's own Tizen Studio CLI, and publishes
9
+ # it as a GitHub Release.
10
+ #
11
+ # Signing note: this used to sign via tizenjs (an unofficial community
12
+ # packaging tool), which produced a .wgt that installed fine as an *update*
13
+ # to an already-trusted app but was rejected with "invalid certificate
14
+ # chain" on a brand-new app id's *first* install. Comparing against three
15
+ # sibling projects (TizenBrew, TizenBrewInstaller, TizenYouTube) that all
16
+ # install fine as fresh apps: the one thing they share and this build didn't
17
+ # is that they're all packaged with Samsung's own official Tizen Studio CLI
18
+ # (`tizen build-web` + `tizen package`), not tizenjs. TizenYouTube in
19
+ # particular proved this isn't about certificate freshness — it uses the
20
+ # exact same (long-expired) Samsung public sample distributor certificate
21
+ # tizenjs was also falling back to, and still installs fine, because it's
22
+ # packaged with the official tool. So this workflow now matches that same
23
+ # working recipe: install Tizen Studio, configure a certificate profile
24
+ # (author cert from secrets + Samsung's public sample distributor cert,
25
+ # same as TizenYouTube/TizenBrew use), and package with `tizen package`
26
+ # instead of tizenjs.
27
+ #
28
+ # This is entirely separate from build-publish-cleanup.yml (which builds and
29
+ # npm-publishes the regular mod on push to main) — different trigger, no
30
+ # shared state, so it doesn't affect that workflow.
31
+ #
32
+ # WHEN IT RUNS
33
+ # ------------
34
+ # - Automatically, right after "Build, publish and cleanup old npm versions"
35
+ # (build-publish-cleanup.yml) finishes successfully on main — i.e. once the
36
+ # userscript's new version has actually been bumped and published to npm.
37
+ # This keeps the standalone app's version in lockstep with the userscript:
38
+ # it reads the version build-publish-cleanup.yml just bumped in package.json
39
+ # and writes that same number into standalone/config.xml before packaging,
40
+ # rather than tracking its own separate version.
41
+ # - On pushing a tag matching v*.*.* (e.g. v1.0.0)
42
+ # - Manually via "Run workflow" (workflow_dispatch)
43
+ #
44
+ # PREREQUISITES (REQUIRED) — Tizen author certificate
45
+ # -----------------------------------------------------
46
+ # The build needs a Tizen author certificate to sign the .wgt.
47
+ #
48
+ # 1) Install Tizen Studio (or just the Certificate Manager) from
49
+ # https://developer.tizen.org/development/tizen-studio/download
50
+ #
51
+ # 2) Open Certificate Manager (Tizen Studio → Tools → Certificate Manager,
52
+ # or run `certificate-manager` directly from the Tizen Studio tools dir).
53
+ #
54
+ # 3) Author tab → "+" → "Create a new author certificate". Fill in a name,
55
+ # organization/email, and a password — remember this password. This
56
+ # produces an author.p12 file (Certificate Manager will tell you where
57
+ # it saved it).
58
+ #
59
+ # 4) Base64-encode the .p12 with NO line wrapping:
60
+ # Linux/macOS: base64 -w0 author.p12
61
+ # Windows (PowerShell):
62
+ # [Convert]::ToBase64String([IO.File]::ReadAllBytes("author.p12"))
63
+ #
64
+ # 5) Add two repository secrets (GitHub repo → Settings → Secrets and
65
+ # variables → Actions → New repository secret):
66
+ # TIZEN_AUTHOR_KEY = the base64 string from step 4
67
+ # TIZEN_AUTHOR_KEY_PW = the certificate password from step 3
68
+ #
69
+ # (The distributor certificate needs no setup — it's Samsung's own public
70
+ # sample certificate, bundled with Tizen Studio and installed automatically
71
+ # by this workflow, same as TizenBrew/TizenYouTube use.)
72
+ #
73
+ # HOW TO TRIGGER A BUILD
74
+ # -----------------------
75
+ # git tag v1.0.0 && git push origin v1.0.0
76
+ # (or use "Run workflow" in the Actions tab for an ad-hoc build)
77
+ # -----------------------------------------------------------------------------
78
+
79
+ name: Build TizenTube Standalone and Release
80
+
81
+ on:
82
+ workflow_run:
83
+ workflows: ['Build, publish and cleanup old npm versions']
84
+ types: [completed]
85
+ push:
86
+ tags:
87
+ - 'v*.*.*'
88
+ workflow_dispatch:
89
+ inputs:
90
+ release_version:
91
+ description: 'Release version/tag name (e.g. v1.0.0)'
92
+ required: false
93
+
94
+ env:
95
+ TIZEN_STUDIO_VER: 5.6
96
+
97
+ jobs:
98
+ build:
99
+ runs-on: ubuntu-latest
100
+ # Only proceed on a successful npm-publish run that was itself triggered by
101
+ # a push to main (build-publish-cleanup.yml's job is skipped entirely for
102
+ # pull_request runs, which can still report an overall "success" — checking
103
+ # .workflow_run.event too avoids firing off of those). Tag pushes and
104
+ # manual dispatch always proceed.
105
+ if: >
106
+ github.event_name != 'workflow_run' ||
107
+ (github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push')
108
+ permissions:
109
+ contents: write
110
+ steps:
111
+ # No explicit ref: default checkout behavior is already correct for every
112
+ # trigger — workflow_run checks out the default branch's current tip,
113
+ # push (tag) checks out the tag, workflow_dispatch checks out the branch
114
+ # it was run from. Pinning to github.event.workflow_run.head_sha (as an
115
+ # earlier version of this workflow did) is wrong: that's the commit that
116
+ # *triggered* build-publish-cleanup.yml, not the version-bump commit it
117
+ # produces partway through its own run — checking that out meant this
118
+ # workflow read package.json *before* the bump, one version behind.
119
+ - name: Clone repo with full history and tags
120
+ uses: actions/checkout@v5
121
+ with:
122
+ fetch-depth: 0
123
+ fetch-tags: true
124
+
125
+ - name: Record the commit this build is actually based on
126
+ run: echo "RELEASE_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
127
+
128
+ - name: Setup Node.js
129
+ uses: actions/setup-node@v6
130
+ with:
131
+ node-version: '24'
132
+
133
+ - name: Determine release version (sync with userscript's package.json)
134
+ run: |
135
+ set -euo pipefail
136
+ if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ github.event.inputs.release_version }}" ]; then
137
+ RELEASE_VERSION="${{ github.event.inputs.release_version }}"
138
+ elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then
139
+ RELEASE_VERSION="${GITHUB_REF#refs/tags/}"
140
+ elif [ -f package.json ]; then
141
+ PKG_VER=$(node -p "require('./package.json').version")
142
+ RELEASE_VERSION="${PKG_VER:+v$PKG_VER}"
143
+ fi
144
+
145
+ if [ -z "${RELEASE_VERSION:-}" ]; then
146
+ CFG_VER=$(sed -n 's/.*<widget[^>]*version="\([^"]*\)".*/\1/p' standalone/config.xml | head -n1)
147
+ RELEASE_VERSION="${CFG_VER:+v$CFG_VER}"
148
+ RELEASE_VERSION="${RELEASE_VERSION:-v0.0.0-${GITHUB_SHA:0:7}}"
149
+ fi
150
+ echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
151
+
152
+ - name: Sync standalone/config.xml version with the userscript's version
153
+ run: |
154
+ set -euo pipefail
155
+ NEW_VER="${RELEASE_VERSION#v}"
156
+ CUR_VER=$(sed -n 's/.*<widget[^>]*version="\([^"]*\)".*/\1/p' standalone/config.xml | head -n1)
157
+ if [ -n "$NEW_VER" ] && [ "$NEW_VER" != "$CUR_VER" ]; then
158
+ sed -i "0,/<widget /s/version=\"${CUR_VER}\"/version=\"${NEW_VER}\"/" standalone/config.xml
159
+ echo "standalone/config.xml version: ${CUR_VER} -> ${NEW_VER}"
160
+ else
161
+ echo "standalone/config.xml version already ${CUR_VER}, nothing to sync"
162
+ fi
163
+
164
+ - name: Determine app metadata for release notes
165
+ run: |
166
+ set -euo pipefail
167
+ APP_ID=$(sed -n 's/.*<tizen:application[^>]*id="\([^"]*\)".*/\1/p' standalone/config.xml | head -n1)
168
+ APP_NAME=$(echo "$APP_ID" | sed -n 's/^[^.]*\.\(.*\)$/\1/p')
169
+ echo "APP_ID=${APP_ID:-unknown}" >> $GITHUB_ENV
170
+ echo "APP_NAME=${APP_NAME:-unknown}" >> $GITHUB_ENV
171
+
172
+ # ----------------------------
173
+ # Build the regular mod + DIAL service — the standalone service wraps
174
+ # dist/service.js, so it must exist before the standalone service builds.
175
+ # ----------------------------
176
+ - name: Build mods (userScript.js)
177
+ working-directory: mods
178
+ run: |
179
+ set -euo pipefail
180
+ npm ci
181
+ npx rollup -c
182
+
183
+ - name: Build service (service.js)
184
+ working-directory: service
185
+ run: |
186
+ set -euo pipefail
187
+ npm ci
188
+ npx rollup -c
189
+
190
+ # ----------------------------
191
+ # Build the standalone service
192
+ # ----------------------------
193
+ - name: Build standalone service
194
+ working-directory: standalone/service
195
+ run: |
196
+ set -euo pipefail
197
+ npm install
198
+ npm install -g @vercel/ncc
199
+ npm run build
200
+ rm -rf node_modules transpiled
201
+
202
+ # ----------------------------
203
+ # Sign and package the standalone app with Tizen Studio
204
+ # ----------------------------
205
+ - name: Download Tizen Studio CLI
206
+ run: |
207
+ set -euo pipefail
208
+ curl -fL -o tizen-installer "https://download.tizen.org/sdk/Installer/tizen-studio_${TIZEN_STUDIO_VER}/web-cli_Tizen_Studio_${TIZEN_STUDIO_VER}_ubuntu-64.bin"
209
+ chmod +x tizen-installer
210
+
211
+ - name: Install Tizen Studio CLI
212
+ run: |
213
+ set -euo pipefail
214
+ ./tizen-installer --accept-license "${GITHUB_WORKSPACE}/tizen-studio"
215
+ rm ./tizen-installer
216
+ echo "${GITHUB_WORKSPACE}/tizen-studio/tools/ide/bin" >> $GITHUB_PATH
217
+
218
+ - name: Configure certificate profile
219
+ env:
220
+ AUTHOR_P12_B64: ${{ secrets.TIZEN_AUTHOR_KEY }}
221
+ AUTHOR_P12_PASSWORD: ${{ secrets.TIZEN_AUTHOR_KEY_PW }}
222
+ run: |
223
+ set -euo pipefail
224
+ mkdir -p "${GITHUB_WORKSPACE}/tizen-data/keystore/author"
225
+ mkdir -p "${GITHUB_WORKSPACE}/tizen-data/profile"
226
+ echo "$AUTHOR_P12_B64" | base64 -d > "${GITHUB_WORKSPACE}/tizen-data/keystore/author/author.p12"
227
+
228
+ echo "Author cert encryption before conversion:"
229
+ openssl pkcs12 -info -in "${GITHUB_WORKSPACE}/tizen-data/keystore/author/author.p12" -passin env:AUTHOR_P12_PASSWORD -noout 2>&1 | grep -i "pbe\|cipher\|mac" || true
230
+
231
+ # Tizen Studio's bundled Java signing tool is old and can fail to read a
232
+ # PKCS#12 file encrypted with the modern AES-256 cipher OpenSSL 3.x (the
233
+ # default everywhere since ~2021) uses by default — throwing a generic,
234
+ # misleading "Invalid password" even when the password is correct. Both
235
+ # node-forge (what tizenjs used) and modern OpenSSL read AES-256 p12s
236
+ # fine, so this wouldn't have surfaced until switching to Tizen Studio's
237
+ # own tooling. Re-encrypt with the older, broadly-compatible cipher
238
+ # in-place — same password, same cert/key contents, just an older wrapper.
239
+ openssl pkcs12 -legacy -in "${GITHUB_WORKSPACE}/tizen-data/keystore/author/author.p12" -out /tmp/author-intermediate.pem -nodes -passin env:AUTHOR_P12_PASSWORD
240
+ openssl pkcs12 -export -legacy -in /tmp/author-intermediate.pem -passout env:AUTHOR_P12_PASSWORD -out "${GITHUB_WORKSPACE}/tizen-data/keystore/author/author.p12" -certpbe PBE-SHA1-3DES -keypbe PBE-SHA1-3DES -macalg sha1
241
+ rm -f /tmp/author-intermediate.pem
242
+
243
+ echo "Author cert encryption after conversion:"
244
+ openssl pkcs12 -info -in "${GITHUB_WORKSPACE}/tizen-data/keystore/author/author.p12" -passin env:AUTHOR_P12_PASSWORD -noout 2>&1 | grep -i "pbe\|cipher\|mac" || true
245
+
246
+ cp .github/assets/profiles.xml "${GITHUB_WORKSPACE}/tizen-data/profile/profiles.xml"
247
+ python3 -c "from pathlib import Path; import os; from xml.sax.saxutils import escape; p=Path(os.environ['GITHUB_WORKSPACE'])/'tizen-data/profile/profiles.xml'; t=p.read_text(); t=t.replace('\$GITHUB_WORKSPACE', os.environ['GITHUB_WORKSPACE']).replace('\$KEY_PW', escape(os.environ['AUTHOR_P12_PASSWORD'], {'\"':'&quot;'})); p.write_text(t)"
248
+
249
+ tizen cli-config "profiles.path=${GITHUB_WORKSPACE}/tizen-data/profile/profiles.xml"
250
+
251
+ - name: Build web app
252
+ working-directory: standalone
253
+ run: >
254
+ tizen build-web
255
+ -e "service/index.js"
256
+ -e "service/injector.js"
257
+ -e "service/bootstrap.js"
258
+ -e "service/build-service.js"
259
+ -e "service/package.json"
260
+ -e "service/package-lock.json"
261
+ -e "service/node_modules"
262
+ -e "release"
263
+
264
+ - name: Package WGT
265
+ working-directory: standalone
266
+ run: |
267
+ set -euo pipefail
268
+ tizen package -t wgt -s TizenTubeStandalone -- ./
269
+ mkdir -p release
270
+ cp *.wgt release/TizenTube.wgt
271
+
272
+ - name: Show Tizen CLI log on failure
273
+ if: failure()
274
+ run: |
275
+ LOG_PATH="${GITHUB_WORKSPACE}/tizen-studio-data/cli/logs/cli.log"
276
+ if [ -f "$LOG_PATH" ]; then
277
+ echo "--- tizen cli.log ---"
278
+ cat "$LOG_PATH"
279
+ else
280
+ echo "No cli.log found at $LOG_PATH"
281
+ fi
282
+
283
+ - name: Upload TizenTube Standalone artifact
284
+ uses: actions/upload-artifact@v6
285
+ with:
286
+ name: TizenTube-Standalone-${{ env.RELEASE_SHA }}.wgt
287
+ path: standalone/release/TizenTube.wgt
288
+
289
+ - name: Release TizenTube Standalone
290
+ uses: softprops/action-gh-release@v1
291
+ with:
292
+ tag_name: ${{ env.RELEASE_VERSION }}
293
+ target_commitish: ${{ env.RELEASE_SHA }}
294
+ body: |
295
+ TizenTube Standalone build from commit `${{ env.RELEASE_SHA }}`, version-synced with the userscript.
296
+ TBI_METADATA: {"appId":"${{ env.APP_ID }}","appName":"${{ env.APP_NAME }}"}
297
+ files: |
298
+ standalone/release/*