diff --git a/.github/workflows/ci_publish.yml b/.github/workflows/ci_publish.yml deleted file mode 100644 index 8606c26..0000000 --- a/.github/workflows/ci_publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish library - -on: - release: - types: [created] - -jobs: - ci_tests: - uses: ./.github/workflows/ci_tests.yml - - ci_publish: - needs: ci_tests - runs-on: ubuntu-latest - - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: 18 - registry-url: https://registry.npmjs.org/ - cache: npm - - - name: Install latest npm - run: npm install -g npm@latest - - - name: Install dependencies - run: npm clean-install --engine-strict - - - name: Build - run: npm run build - - - name: Publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: npm publish ./dist --access public diff --git a/.github/workflows/ci_release.yml b/.github/workflows/ci_release.yml new file mode 100644 index 0000000..88bf943 --- /dev/null +++ b/.github/workflows/ci_release.yml @@ -0,0 +1,14 @@ +name: Release library + +on: + release: + types: [created] + +jobs: + ci_release: + uses: dsi-hug/action/.github/workflows/action.yml@v1 + secrets: + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + with: + lint: false + release: true diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 4cbc0d3..221fc59 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -1,14 +1,12 @@ name: Run tests on: + workflow_dispatch: push: branches: - - '**' + - '**' tags-ignore: - - '**' - pull_request: - workflow_call: - workflow_dispatch: + - '**' concurrency: group: run-tests-group-${{ github.ref }} @@ -16,50 +14,8 @@ concurrency: jobs: ci_tests: - name: Tests on ${{ matrix.os }} node${{ matrix.node }} - runs-on: ${{ matrix.os }} - - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - node: [18, 20] - - steps: - - name: Checkout sources - uses: actions/checkout@v4 - - - name: Setup node - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - registry-url: https://registry.npmjs.org/ - cache: npm - - # https://github.com/actions/setup-node/issues/411 - # https://github.com/npm/cli/issues/4341 - - name: Workaround for npm installation on Windows - if: ${{ matrix.os == 'windows-latest' }} - run: npm install -g npm@8.3.1 - - - name: Install latest npm - run: npm install -g npm@latest - - - name: Cache node_modules - uses: actions/cache@v4 - id: cache-step - with: - key: cache-${{ matrix.os }}-node${{ matrix.node }}-${{ hashFiles('package-lock.json') }} - restore-keys: | - cache-${{ matrix.os }}-node${{ matrix.node }}- - path: | - node_modules - - - name: Install dependencies - if: steps.cache-step.outputs.cache-hit != 'true' - run: npm clean-install --engine-strict - - - name: Tests - run: npm run test - - - name: Build - run: npm run build + uses: dsi-hug/action/.github/workflows/action.yml@v1 + with: + runs-on: '["ubuntu-latest", "macos-latest", "windows-latest"]' + node-versions: '[18, 20]' + lint: false diff --git a/package.json b/package.json index b6b70d5..50d913b 100755 --- a/package.json +++ b/package.json @@ -28,7 +28,9 @@ "scripts": { "ncu": "npx npm-check-updates -i --format=group --packageFile '{,tests/**/}package.json'", "test": "npm run test --prefix ./tests", - "build": "ng-packagr -p ng-package.json" + "test:ci": "npm run test", + "build": "ng-packagr -p ng-package.json", + "release": "npm publish ./dist --access public" }, "peerDependencies": { "@angular/core": ">= 14.0.0",