diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 42a9bb9..feed247 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -7,8 +7,68 @@ on: env: CI: true + node-version: 16 jobs: - publish: - uses: haraka/.github/.github/workflows/publish.yml@master - secrets: inherit \ No newline at end of file + build: + runs-on: ubuntu-latest + # services: + # redis: + # image: redis + # ports: + # - 6379:6379 + steps: + - name: Configure sysctl limits + run: | + sudo swapoff -a + sudo sysctl -w vm.swappiness=1 + sudo sysctl -w fs.file-max=262144 + sudo sysctl -w vm.max_map_count=262144 + - uses: miyataka/elasticsearch-github-actions@1 + with: + stack-version: '7.6.2' + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.node-version }} + - uses: actions/checkout@v3 + - run: npm install + - run: npm test + + publish-npm: + needs: [ build ] + runs-on: ubuntu-latest + environment: npm + steps: + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.node-version }} + registry-url: https://registry.npmjs.org/ + - uses: actions/checkout@v3 + with: + fetch-depth: 0 # needed by GitHub Release + - name: publish to NPM + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }} + + publish-gpr: + needs: [ build ] + runs-on: ubuntu-latest + environment: ghpm + permissions: + contents: read + packages: write + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: actions/setup-node@v3 + with: + node-version: ${{ env.node-version }} + registry-url: https://npm.pkg.github.com/ + scope: "@haraka" + - name: rename package with @haraka scope + run: node .release/npm/prepend-scope.cjs @haraka + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..260094b --- /dev/null +++ b/.npmignore @@ -0,0 +1,4 @@ +.github +.release +.gitmodules +.codeclimate.yml diff --git a/Changes.md b/Changes.md index 0dfb016..a572f53 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,12 @@ ### Unreleased +### [1.0.8] - 2022-06-06 + +- ci: add .npmignore +- ci: publish needs es started up too + + ### [1.0.7] - 2022-06-06 - ci: use shared GHA workflows @@ -51,3 +57,4 @@ - initial release [1.0.7]: https://github.com/haraka/haraka-plugin-elasticsearch/releases/tag/1.0.7 +[1.0.8]: https://github.com/haraka/haraka-plugin-elasticsearch/releases/tag/1.0.8 diff --git a/package.json b/package.json index 6f82700..19442ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haraka-plugin-elasticsearch", - "version": "1.0.7", + "version": "1.0.8", "description": "Haraka plugin that saves logs to Elasticsearch", "main": "index.js", "scripts": {