feat: refactor & upgrade to Angular 16, main dependencies (no RxDB upgrade yet) #75
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: main | |
# Controls when the action will run. | |
on: | |
# Triggers the workflow on push or pull request events but only for the master branch | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
types: [opened, synchronize, reopened] | |
release: | |
types: [published] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
# strategy: | |
# matrix: | |
# node-version: [12.x, 14.x] | |
steps: | |
- name: My first step | |
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }} | |
run: echo This event is a pull request that was opened. | |
# | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
persist-credentials: false | |
# | |
- name: Build on Node.js # ${{ matrix.node-version }} | |
uses: actions/setup-node@v2 | |
with: | |
# node-version: ${{ matrix.node-version }} | |
node-version: 12 | |
# | |
- name: Cache node modules | |
uses: actions/cache@v2 | |
env: | |
cache-name: cache-node-modules | |
with: | |
# npm cache files are stored in `~/.npm` on Linux/macOS | |
path: ~/.npm | |
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-build-${{ env.cache-name }}- | |
${{ runner.os }}-build- | |
${{ runner.os }}- | |
# | |
- name: Install | |
run: npm ci | |
- name: Lint & Test | |
run: npm run packages:lint && npm run packages:test | |
env: | |
CI: true | |
# Save coverage report in Coveralls | |
- name: Coveralls | |
if: ${{ success() }} | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
# env: | |
# COVERALLS_SERVICE_NAME: '@ngx-odm' | |
# COVERALLS_PARALLEL: true | |
# Build if release published | |
- name: Build | |
# if: github.event.release.published | |
run: npm run packages:build | |
- name: Archive production artifacts | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dist-packages | |
path: | |
dist/packages | |
# !dist/**/*.md | |
publish: | |
# if: github.event.pull_request.merged | |
# if: github.event.release.published | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
# - uses: actions/checkout@v2 | |
# - name: Download all workflow run artifacts | |
- uses: actions/cache@v2 | |
- uses: actions/download-artifact@v2 | |
- name: Version and publish | |
run: | | |
git config user.name $GITHUB_ACTOR | |
git config user.email gh-actions-${GITHUB_ACTOR}@github.com | |
git remote add gh-origin https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | |
npm version minor --force -m "v%s" -m "build(*): release new version [build-skip]" | |
git push gh-origin HEAD:master --tags | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 12 | |
registry-url: 'https://registry.npmjs.org' | |
- run: | | |
npm run packages:publish:dev | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- uses: actions/setup-node@v2 | |
with: | |
registry-url: 'https://npm.pkg.github.com' | |
- run: | | |
npm run packages:publish:dev | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} # https://docs.github.com/en/free-pro-team@latest/actions/reference/authentication-in-a-workflow#about-the-github_token-secret |