diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..95b7c44 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,44 @@ +--- +"on": + push: + paths-ignore: + - "**.md" + pull_request: + paths-ignore: + - "**.md" + workflow_dispatch: + +# https://github.com/softprops/action-gh-release/issues/236 +permissions: + contents: write + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: latest + registry-url: https://registry.npmjs.org + - name: Install dependencies + run: | + sudo apt-get -y update + sudo apt-get -y install librime-dev libjson-c-dev librime1 libjson-c5 + yarn + - name: Build + run: | + yarn pack + env: + NODE_ENV: production + - uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + files: "*.tgz" + - name: Publish + env: + NODE_AUTH_TOKEN: ${{secrets.NODE_AUTH_TOKEN}} + NODE_ENV: production + if: startsWith(github.ref, 'refs/tags/') + run: | + yarn publish diff --git a/binding.gyp b/binding.gyp index c051539..44b74d6 100644 --- a/binding.gyp +++ b/binding.gyp @@ -17,6 +17,8 @@ "