@lumen5/beamcoder 0.0.4 → 0.0.12

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,85 @@
1
+ # Build prebuilt binaries and publish to npm
2
+ name: Build & Publish
3
+
4
+ on:
5
+ push:
6
+ # branches: [main]
7
+ pull_request:
8
+ branches: [main]
9
+ workflow_dispatch:
10
+
11
+ jobs:
12
+ build:
13
+ runs-on: ubuntu-latest
14
+ env:
15
+ CPATH: /tmp/beamcoder/.ffmpeg/ffmpeg/include/
16
+ PKG_CONFIG_PATH: /tmp/beamcoder/.ffmpeg/ffmpeg/lib/pkgconfig/
17
+ steps:
18
+ - uses: actions/checkout@v3
19
+
20
+ - uses: actions/setup-node@v3
21
+ with:
22
+ node-version: 22
23
+ registry-url: https://registry.npmjs.org/
24
+
25
+ - name: Get package version
26
+ id: version
27
+ run: echo "version=$(node -p "require('./package.json').version")" >> $GITHUB_OUTPUT
28
+
29
+ - name: Create working directory
30
+ run: mkdir /tmp/beamcoder
31
+
32
+ - name: Copy source
33
+ run: cp -r . /tmp/beamcoder
34
+
35
+ - name: Install system dependencies
36
+ run: sudo apt-get update && sudo apt-get install -y libvpx-dev
37
+
38
+ - name: Install FFmpeg dependencies
39
+ run: sudo ./scripts/install_beamcoder_dependencies.sh
40
+ working-directory: /tmp/beamcoder
41
+
42
+ - name: Install dependencies (skip native build)
43
+ run: yarn install --frozen-lockfile --ignore-scripts
44
+ working-directory: /tmp/beamcoder
45
+
46
+ - name: Download FFmpeg static libraries
47
+ run: node install_ffmpeg_static.js
48
+ working-directory: /tmp/beamcoder
49
+
50
+ - name: Build prebuild
51
+ run: npx prebuild --strip -r node -t 22.0.0
52
+ working-directory: /tmp/beamcoder
53
+ env:
54
+ FFMPEG_STATIC: "1"
55
+
56
+ - name: List prebuilds
57
+ run: find /tmp/beamcoder/prebuilds -name "*.tar.gz" -ls
58
+
59
+ - name: Create or update release
60
+ # if: github.ref == 'refs/heads/main'
61
+ run: |
62
+ VERSION="v${{ steps.version.outputs.version }}"
63
+ # Check if release exists
64
+ if gh release view "$VERSION" >/dev/null 2>&1; then
65
+ echo "Release $VERSION exists, uploading prebuilds..."
66
+ else
67
+ echo "Creating release $VERSION..."
68
+ gh release create "$VERSION" --title "$VERSION" --notes "Prebuilt binaries for version $VERSION"
69
+ fi
70
+ # Upload prebuilds (handle scoped package subdirectory)
71
+ find /tmp/beamcoder/prebuilds -name "*.tar.gz" -exec gh release upload "$VERSION" {} --clobber \;
72
+ env:
73
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
74
+
75
+ - name: Build for npm publish
76
+ # if: github.ref == 'refs/heads/main'
77
+ run: FFMPEG_STATIC=1 npx node-gyp rebuild
78
+ working-directory: /tmp/beamcoder
79
+
80
+ - name: Publish to npm
81
+ # if: github.ref == 'refs/heads/main'
82
+ run: npm publish
83
+ working-directory: /tmp/beamcoder
84
+ env:
85
+ NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "@lumen5/beamcoder",
3
- "version": "0.0.4",
3
+ "version": "0.0.12",
4
4
  "description": "Node.js native bindings to FFmpeg.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
7
7
  "scripts": {
8
8
  "preinstall": "node install_ffmpeg_static.js",
9
- "install": "FFMPEG_STATIC=1 node-gyp rebuild",
9
+ "install": "prebuild-install || (FFMPEG_STATIC=1 node-gyp rebuild)",
10
10
  "preinstall:dynamic": "node install_ffmpeg.js",
11
11
  "install:dynamic": "FFMPEG_STATIC=0 node-gyp rebuild",
12
12
  "build:dynamic": "npm run preinstall:dynamic && npm run install:dynamic",
13
+ "prebuild": "FFMPEG_STATIC=1 prebuild --strip",
13
14
  "test": "tape test/*.js",
14
15
  "lint": "eslint **/*.js",
15
16
  "lint-html": "eslint **/*.js -f html -o ./reports/lint-results.html",
@@ -17,7 +18,7 @@
17
18
  },
18
19
  "repository": {
19
20
  "type": "git",
20
- "url": "git+https://github.com/Streampunk/beamcoder.git"
21
+ "url": "git+https://github.com/Lumen5/beamcoder.git"
21
22
  },
22
23
  "keywords": [
23
24
  "FFmpeg",
@@ -37,10 +38,12 @@
37
38
  },
38
39
  "homepage": "https://github.com/Streampunk/beamcoder#readme",
39
40
  "dependencies": {
40
- "bindings": "^1.5.0"
41
+ "bindings": "^1.5.0",
42
+ "prebuild-install": "^7.1.0"
41
43
  },
42
44
  "devDependencies": {
43
45
  "eslint": "^8.9.0",
46
+ "prebuild": "^13.0.0",
44
47
  "tape": "^5.5.2"
45
48
  },
46
49
  "gypfile": true
@@ -1,32 +0,0 @@
1
- # This workflow will publish npm package on release
2
- # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
-
4
- name: Node.js Package
5
-
6
- on:
7
- release:
8
- types: [created]
9
-
10
- jobs:
11
- publish-npm:
12
- runs-on: ubuntu-latest
13
- env:
14
- CPATH: /tmp/beamcoder/.ffmpeg/ffmpeg/include/
15
- PKG_CONFIG_PATH: /tmp/beamcoder/.ffmpeg/ffmpeg/lib/pkgconfig/
16
- steps:
17
- - uses: actions/checkout@v3
18
- - uses: actions/setup-node@v3
19
- with:
20
- node-version: 20
21
- registry-url: https://registry.npmjs.org/
22
- - run: mkdir /tmp/beamcoder
23
- - run: cp -r . /tmp/beamcoder
24
- - run: sudo apt-get update && sudo apt-get install -y libvpx-dev
25
- - run: sudo ./scripts/install_beamcoder_dependencies.sh
26
- working-directory: /tmp/beamcoder
27
- - run: yarn install --frozen-lockfile
28
- working-directory: /tmp/beamcoder
29
- - run: yarn publish
30
- working-directory: /tmp/beamcoder
31
- env:
32
- NODE_AUTH_TOKEN: ${{secrets.npm_token}}