Skip to content

🎥 Make videos programmatically with React

post new releases to github

Jonny Burger442b57b54d9c
diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml
new file mode 100644
index 0000000000..0ca1a51084
--- /dev/null
+++ b/.github/workflows/changelog.yml
@@ -0,0 +1,24 @@
+on:
+ push:
+ branches:
+ - main
+ release:
+ types: [edited, published]
+ workflow_dispatch:
+name: Publish latest release
+
+jobs:
+ post:
+ name: Post on Discord
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@main
+ - uses: actions/setup-node@v3
+ with:
+ node-version: ${{ matrix.node_version }}
+ - name: Push changelog
+ env:
+ DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
+ run: |
+ cd packages/discord-poster
+ node post.mjs
diff --git a/packages/discord-poster/package.json b/packages/discord-poster/package.json
new file mode 100644
index 0000000000..ee648283d0
--- /dev/null
+++ b/packages/discord-poster/package.json
@@ -0,0 +1,14 @@
+{
+ "name": "@remotion/discord-poster",
+ "version": "3.0.27",
+ "license": "SEE LICENSE IN LICENSE.md",
+ "type": "module",
+ "scripts": {
+ "discord": "ts-node src/post.ts"
+ },
+ "private": true,
+ "devDependencies": {
+ "typescript": "^4.7.0",
+ "@types/node": "^18.0.3"
+ }
+}
diff --git a/packages/discord-poster/post.mjs b/packages/discord-poster/post.mjs
new file mode 100644
index 0000000000..5f5a80bc7c
--- /dev/null
+++ b/packages/discord-poster/post.mjs
@@ -0,0 +1,44 @@
+const latestRelease = await fetch(
+ "https://api.github.com/repos/remotion-dev/remotion/releases?per_page=1"
+);
+
+const json = await latestRelease.json();
+
+const markdown = [
+ `${json[0].tag_name} has been released!`,
+ `<:merge:909914451447259177> ${json[0].html_url}`,
+ "",
+ json[0].body
+ .split("\n")
+ .map((s) => {
+ if (s.startsWith("## ")) {
+ return s.replace("## ", "**<:love:989990489824559104> ") + "**";
+ }
+ return s;
+ })
+ .join("\n"),
+].join("\n");
+
+const formatBody = () => {};
+
+const res = await fetch(
+ `https://discord.com/api/channels/994527481598070815/messages`,
+ {
+ method: "post",
+ body: JSON.stringify({
+ content: markdown,
+ allowed_mentions: {},
+ flags: 1 << 2,
+ }),
+ headers: {
+ "Content-Type": "application/json",
+ Authorization: `Bot ${process.env.DISCORD_TOKEN}`,
+ },
+ }
+);
+
+if (res.status !== 200) {
+ process.exit(1);
+}
+
+export {};
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7e8389a571..7d7050bb05 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -238,6 +238,14 @@ importers:
prettier-plugin-organize-imports: 2.3.4_lbsuufegg2dnc4wh6qgf26kgdy
typescript: 4.7.2
+ packages/discord-poster:
+ specifiers:
+ '@types/node': ^18.0.3
+ typescript: ^4.7.0
+ devDependencies:
+ '@types/node': 18.0.3
+ typescript: 4.7.2
+
packages/docs:
specifiers:
'@babel/plugin-transform-modules-commonjs': ^7.15.4
@@ -6209,7 +6217,7 @@ packages:
dependencies:
'@types/istanbul-lib-coverage': 2.0.3
'@types/istanbul-reports': 3.0.1
- '@types/node': 17.0.17
+ '@types/node': 18.0.3
'@types/yargs': 16.0.4
chalk: 4.1.2
@@ -7773,6 +7781,9 @@ packages:
/@types/node/17.0.17:
resolution: {integrity: sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw==}
+ /@types/node/18.0.3:
+ resolution: {integrity: sha512-HzNRZtp4eepNitP+BD6k2L6DROIDG4Q0fm4x+dwfsr6LGmROENnok75VGw40628xf+iR24WeMFcHuuBDUAzzsQ==}
+
/@types/normalize-package-data/2.4.1:
resolution: {integrity: sha512-Gj7cI7z+98M282Tqmp2K5EIsoouUEzbBJhQQzDE3jSIRk6r9gsz0oUokqIUR4u1R3dMHo0pDHM7sNOHyhulypw==}
dev: false
@@ -7902,7 +7913,7 @@ packages:
/@types/sharp/0.28.6:
resolution: {integrity: sha512-AjKjo5vk5mkcTrWL0U1zFUdCp/uqLebvbe7ezAJx0tgp6ST9JmfsYK1q1lpjfPM5S1YQ1wr5uboPSu2S8UO9yw==}
dependencies:
- '@types/node': 16.10.2
+ '@types/node': 18.0.3
dev: true
/@types/sockjs/0.3.33:
@@ -13962,11 +13973,11 @@ packages:
engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0}
dependencies:
'@jest/types': 27.2.4
- '@types/node': 17.0.17
+ '@types/node': 18.0.3
chalk: 4.1.2
graceful-fs: 4.2.10
is-ci: 3.0.0
- picomatch: 2.3.0
+ picomatch: 2.3.1
/jest-validate/27.2.4:
resolution: {integrity: sha512-VMtbxbkd7LHnIH7PChdDtrluCFRJ4b1YV2YJzNwwsASMWftq/HgqiqjvptBOWyWOtevgO3f14wPxkPcLlVBRog==}
@@ -18076,7 +18087,7 @@ packages:
dev: false
/set-blocking/2.0.0:
- resolution: {integrity: sha1-BF+XgtARrppoA93TgrJDkrPYkPc=}
+ resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==}
/set-value/2.0.1:
resolution: {integrity: sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==}
@@ -18203,7 +18214,7 @@ packages:
dev: true
/simple-swizzle/0.2.2:
- resolution: {integrity: sha1-pNprY1/8zMoz9w0Xy5JZLeleVXo=}
+ resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==}
dependencies:
is-arrayish: 0.3.2
dev: true
@@ -18573,7 +18584,7 @@ packages:
strip-ansi: 6.0.1
/string-width/1.0.2:
- resolution: {integrity: sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=}
+ resolution: {integrity: sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==}
engines: {node: '>=0.10.0'}
dependencies:
code-point-at: 1.1.0
@@ -18671,7 +18682,7 @@ packages:
dev: false
/strip-ansi/3.0.1:
- resolution: {integrity: sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=}
+ resolution: {integrity: sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==}
engines: {node: '>=0.10.0'}
dependencies:
ansi-regex: 2.1.1
@@ -18722,7 +18733,7 @@ packages:
dev: false
/strip-json-comments/2.0.1:
- resolution: {integrity: sha1-PFMZQukIwml8DsNEhYwobHygpgo=}
+ resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==}
engines: {node: '>=0.10.0'}
/strip-json-comments/3.1.1:
@@ -19247,10 +19258,10 @@ packages:
fast-json-stable-stringify: 2.1.0
jest: 27.2.4
jest-util: 27.2.4
- json5: 2.2.0
+ json5: 2.2.1
lodash: 4.17.21
make-error: 1.3.6
- semver: 7.3.5
+ semver: 7.3.7
typescript: 4.7.2
yargs-parser: 20.2.9
@@ -19277,10 +19288,10 @@ packages:
fast-json-stable-stringify: 2.1.0
jest: 27.2.4
jest-util: 27.2.4
- json5: 2.2.0
+ json5: 2.2.1
lodash: 4.17.21
make-error: 1.3.6
- semver: 7.3.5
+ semver: 7.3.7
typescript: 4.7.2
yargs-parser: 20.2.9
dev: true
@@ -19307,10 +19318,10 @@ packages:
fast-json-stable-stringify: 2.1.0
jest: 27.2.4
jest-util: 27.2.4
- json5: 2.2.0
+ json5: 2.2.1
lodash: 4.17.21
make-error: 1.3.6
- semver: 7.3.5
+ semver: 7.3.7
typescript: 4.7.2
yargs-parser: 20.2.9
dev: true
@@ -19387,7 +19398,7 @@ packages:
typescript: 4.7.2
/tunnel-agent/0.6.0:
- resolution: {integrity: sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=}
+ resolution: {integrity: sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==}
dependencies:
safe-buffer: 5.2.1