Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
feat: hermesc npm package (#7)
Browse files Browse the repository at this point in the history
* workflow: add cli action and bump to c++ 20

* test new hermesc workflow stuff

* test

* fix

* test

* revert this flag

* fix

* fix copy item

* test

* fix 2

* add publish

* GUH

* remove other packages

* guhhh

* the guh guh

* GUH

* test

* small fix

* fix

* Add version

* change package name to @aliucord/hermesc

* add release option

* make it also run on every push
* also make ci run on every push

* add version input

* add default value for version

* small change

* add tarball

* forgor .tgz

* fix npm pack

* fix tarball guhh

* i forgot a |

* HORROR

* Run action on PR

* add readme
  • Loading branch information
nikosszzz authored Jan 30, 2023
1 parent a92a78b commit 7a6e06f
Show file tree
Hide file tree
Showing 9 changed files with 156 additions and 90 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ concurrency:

on:
push:
branches:
- aliu
- 0.11.0-aliucord
- 0.12.0-aliucord

pull_request:
workflow_dispatch:

Expand Down
133 changes: 133 additions & 0 deletions .github/workflows/compile-hermesc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: Compile Hermesc Package

on:
pull_request:
push:
workflow_dispatch:
inputs:
release:
type: boolean
description: Publish release to NPM
default: false
version:
type: string
description: Package version
required: false

jobs:
build-windows:
runs-on: "windows-2019"

steps:
- name: ccache
uses: hendrikmuhs/[email protected]
with:
variant: sccache
key: windows
- uses: actions/checkout@v3
- name: Compile Hermesc for Windows
run: |
choco install ninja
cmake -S . -B build -G 'Visual Studio 16 2019' -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
Copy-Item -Path "c:\windows\system32\msvcp140.dll" -Destination ".\build\bin\Release"
Copy-Item -Path "c:\windows\system32\vcruntime140.dll" -Destination ".\build\bin\Release"
Copy-Item -Path "c:\windows\system32\vcruntime140_1.dll" -Destination ".\build\bin\Release"
- uses: actions/upload-artifact@v3
name: Upload Windows Binaries
with:
name: hermesc-windows
path: |
build/bin/Release/hermesc.exe
build/bin/Release/vcruntime140_1.dll
build/bin/Release/vcruntime140.dll
build/bin/Release/msvcp140.dll
build-linux:
runs-on: "ubuntu-latest"

steps:
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: linux
- uses: actions/checkout@v3
- name: Compile Hermesc for Linux
run: |
sudo apt update
sudo apt install cmake git ninja-build libicu-dev python2 zip libreadline-dev
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
- uses: actions/upload-artifact@v3
name: Upload Linux Binaries
with:
name: hermesc-linux
path: build/bin/hermesc

build-mac:
runs-on: "macos-latest"

steps:
- name: ccache
uses: hendrikmuhs/[email protected]
with:
key: macos
- uses: actions/checkout@v3
- name: Compile Hermesc for MacOS
run: |
brew install cmake git ninja
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build ./build --config Release --target hermesc
- uses: actions/upload-artifact@v3
name: Upload MacOS Binaries
with:
name: hermesc-mac
path: build/bin/hermesc

package:
runs-on: "ubuntu-latest"
needs: [build-windows, build-linux, build-mac]

steps:
- uses: actions/checkout@v3

- uses: actions/download-artifact@v3
with:
name: hermesc-linux
path: ./npm/hermesc/linux64-bin

- uses: actions/download-artifact@v3
with:
name: hermesc-mac
path: ./npm/hermesc/osx-bin

- uses: actions/download-artifact@v3
with:
name: hermesc-windows
path: ./npm/hermesc/win64-bin

- uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://registry.npmjs.org'

- name: Make NPM Tarball
run: |
cd npm/hermesc
npm pkg set version=${{ inputs.version || github.ref_name }}
npm pack
- uses: actions/upload-artifact@v3
name: Upload Hermesc Tarball
with:
name: hermesc-tarball
path: ./npm/hermesc/*.tgz

- name: NPM Publish
if: ${{ inputs.release == true }}
run: |
cd npm/hermesc
npm pkg set version=${{ inputs.version || github.ref_name }}
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion npm/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ osx-bin
package-lock.json
destroot
LICENSE
README.md
hermes.podspec
12 changes: 0 additions & 12 deletions npm/hermes-engine-cli/README.md

This file was deleted.

35 changes: 0 additions & 35 deletions npm/hermes-engine-cli/package.json

This file was deleted.

12 changes: 0 additions & 12 deletions npm/hermes-engine/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions npm/hermes-engine/package.json

This file was deleted.

3 changes: 3 additions & 0 deletions npm/hermesc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## Hermesc

This package contains `hermesc` binaries of the Hermes Compiler from our own fork of Hermes that targets the bytecode version that Discord React Native uses.
20 changes: 20 additions & 0 deletions npm/hermesc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "@aliucord/hermesc",
"version": "<version>",
"private": false,
"description": "Hermes compiler binaries",
"license": "MIT",
"repository": {
"type": "git",
"url": "[email protected]:Aliucord/hermes.git"
},
"files": [
"README.md",
"linux64-bin/hermesc",
"osx-bin/hermesc",
"win64-bin/hermesc.exe",
"win64-bin/msvcp140.dll",
"win64-bin/vcruntime140.dll",
"win64-bin/vcruntime140_1.dll"
]
}

0 comments on commit 7a6e06f

Please sign in to comment.