diff --git a/.github/workflows/publish-on-npm-angular8.yml b/.github/workflows/publish-on-npm-angular8.yml new file mode 100644 index 0000000..f90a7ae --- /dev/null +++ b/.github/workflows/publish-on-npm-angular8.yml @@ -0,0 +1,46 @@ +name: "Bump version and publish on npm" + +on: + workflow_dispatch: + branches: + - "angular8" + +jobs: + build-test-deploy: + name: Build, test, bump version and deploy the library on npm + runs-on: ubuntu-latest + + steps: + - uses: actions/setup-node@master + with: + node-version: "10" + registry-url: "https://registry.npmjs.org" + + - uses: actions/checkout@master + + - name: "Install dependency" + run: npm ci + + - name: "Automated version bump for library" + uses: "phips28/gh-action-bump-version@master" + with: + tag-prefix: "" + env: + PACKAGEJSON_DIR: "./projects/ngx-image-compress" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + target-branch: "angular8" + + - name: 'Build' + run: npm run build + + - name: "Ship the README.md with the library build" + run: cp ./README.md ./dist/ngx-image-compress/README.md + + - name: "Ship the LICENSE" + run: cp ./LICENSE ./dist/ngx-image-compress/LICENSE + + - name: "Publish the library on npm" + working-directory: ./dist/ngx-image-compress + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npm publish --tag angular-8-compatibility diff --git a/README.md b/README.md index ec11e82..9ce9506 100644 --- a/README.md +++ b/README.md @@ -18,10 +18,8 @@ npm i ngx-image-compress - For **visualizing** code examples: https://stackblitz.com/edit/ngx-image-compress - For **performance tests**, in particular on your mobile, please **do not use stackbliz**, put this production-ready application: https://image-library.app -- Any Angular **version > 9** supporting Ivy is compatible. (Library transpiled with Ivy in partial mode, as it's now mandatory to process - in Angular 13) -- For Angular **version < 9** can try this once-for-all compiled library using legacy View Engine: - https://www.npmjs.com/package/ngx-image-compress-legacy +- Compatible with any Angular **version > 9** +- If you use Angular **version < 9**, use versions 8.12.x - For example `npm install ngx-image-compress@8.12.2` Angular 13+ differ as there is no need to import the service in your module. You can inject the service in the constructor of your component directly.