-
Notifications
You must be signed in to change notification settings - Fork 6
85 lines (75 loc) · 2.62 KB
/
release-and-publish-packages.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release and Publish Packages
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: write
packages: write
pull-requests: write
jobs:
release-and-publish-packages:
runs-on: ubuntu-latest
steps:
- uses: google-github-actions/release-please-action@v3
with:
command: manifest
monorepo-tags: true
token: ${{ secrets.GITHUB_TOKEN }}
id: release
- name: Checkout Repository
if: ${{ steps.release.outputs.releases_created }}
uses: actions/checkout@v3
with:
ref: main
- name: Cache node modules
if: ${{ steps.release.outputs.releases_created }}
id: cache-npm
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
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: List the state of node modules
if: ${{ steps.cache-npm.outputs.cache-hit != 'true' }} && ${{ steps.release.outputs.releases_created }}
continue-on-error: true
run: npm list
- name: Setup Node
if: ${{ steps.release.outputs.releases_created }}
uses: actions/setup-node@v3
with:
node-version: 18
registry-url: 'https://npm.pkg.github.com'
scope: '@juntossomosmais'
- name: Authenticate with the GitHub Package Registry
if: ${{ steps.release.outputs.releases_created }}
run: |
echo "//npm.pkg.github.com/:_authToken=$NODE_AUTH_TOKEN
@juntossomosmais:registry=https://npm.pkg.github.com" > ~/.npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
if: ${{ steps.release.outputs.releases_created }}
run: npm ci --legacy-peer-deps
- name: Build and publish Core
if: ${{ steps.release.outputs['packages/core--release_created'] }}
run: |
npm run core:build
npx nx run @juntossomosmais/atomium:publish-library
continue-on-error: false
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Build and publish Tokens
if: ${{ steps.release.outputs['packages/tokens--release_created'] }}
run: |
npm run tokens:build
npx nx run @juntossomosmais/atomium-tokens:publish-library
continue-on-error: false
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}