Skip to content

ci: setup releases

ci: setup releases #14

# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests across different versions of node
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: "@ngx-tailwind/ui"
on:
push:
branches: [ "next", "release", "master" ]
paths: [ "projects/ngx-tailwind-ui/**", ".github/workflows/ngx-tailwind-ui.yml" ]
pull_request:
branches: [ "next" ]
paths: [ "projects/ngx-tailwind-ui/**" ]
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTHTOKEN }}
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [20]
project: [ngx-tailwind-ui]
steps:
- uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'pnpm'
- name: Install dependencies
run: |
pnpm add @ngx-tailwind/core@file:projects/ngx-tailwind-core/src
sed "s/ngx-tailwind/temp/g" -i ./tsconfig.json
pnpm install
- name: Lint
run: pnpm lint:${{ matrix.project }}
- name: Build
run: pnpm build:${{ matrix.project }}
- name: Test
run: |
sed "s/temp/ngx-tailwind/g" -i ./tsconfig.json
pnpm install-chrome
pnpm test:${{ matrix.project }}:ci
- name: Publish test results summary
uses: janisz/action@v2
with:
paths: "junit/**/TESTS-*.xml"
- name: Publish artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.project }}-${{ github.run_id }}
path: "dist/${{ matrix.project }}"
- if: github.event_name == 'push' && github.ref == 'refs/heads/release'
name: Publish @beta
run: |
cd dist/${{ matrix.project }}
pnpm version ${{ vars.BETA_VERSION }}
pnpm publish --tag beta --no-git-checks
- if: github.event_name == 'push' && github.ref == 'refs/heads/master'
name: Publish @latest
run: |
cd dist/${{ matrix.project }}
pnpm version ${{ vars.LATEST_VERSION }}
pnpm publish --tag latest --no-git-checks
- if: github.event_name == 'push' && github.ref == 'refs/heads/next'
name: Publish @alpha
run: |
cd dist/${{ matrix.project }}
pnpm version ${{ vars.ALPHA_VERSION }}
pnpm publish --tag alpha --no-git-checks