forked from po-ui/po-angular
-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (47 loc) · 1.64 KB
/
publish_po_angular_ci-latest.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: PO-UI Publish - Latest
# URL para os pacotes po-ui no npm
env:
COMPONENTS_NPM_PATH: po-ui/ng-components
WORKING_DIR: /home/runner/work/po-angular-teste/po-angular-teste/po-angular
on:
workflow_dispatch:
jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Check out po-angular
uses: actions/checkout@v4
with:
path: po-angular
- name: Check out style
uses: actions/checkout@v4
with:
repository: po-ui/po-style
path: po-style
- name: Check out lint
uses: actions/checkout@v4
with:
repository: po-ui/po-tslint
path: po-tslint
- name: Install and Build
run: npm install && npm run build:ui
working-directory: ${{env.WORKING_DIR}}
# Pega a última versão dos pacotes publicados no npm e armazena em variáveis
- run: echo "COMPONENTS_LAST_PUBLISHED_VERSION=$(npm view @${{ env.COMPONENTS_NPM_PATH }} dist-tags.latest)" >> $GITHUB_ENV
# Pega a versão no package.json
- name: Get package.json version.
id: package-version
uses: martinbeentjes/npm-get-version-action@main
with:
path: po-angular
# PUBLISH NG-COMPONENTS
- name: ng-components - publish
if: (!contains(env.PACKAGE_VERSION, env.COMPONENTS_LAST_PUBLISHED_VERSION))
uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm publish ${{env.WORKING_DIR}}/dist/ng-components --tag latest --ignore-scripts
env:
PACKAGE_VERSION: ${{ steps.package-version.outputs.current-version }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}