-
Notifications
You must be signed in to change notification settings - Fork 65
74 lines (73 loc) · 2.11 KB
/
publish_icons.yaml
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
# TODO: Create a composite action for publishing to simplify things
name: Publish icons
on:
workflow_dispatch:
inputs:
npm-tag:
description: 'Tag for npm package (next | latest)'
required: true
default: 'next'
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
jobs:
setup:
uses: equinor/design-system/.github/workflows/_setup.yml@develop
secrets: inherit
with:
cacheKey: ${{ github.sha }}-setup-icons
checkout_paths: packages/eds-icons
tag: ${{ github.event.inputs.npm-tag }}
packages:
name: Process packages
runs-on: ubuntu-latest
needs: [setup]
steps:
- name: Use "setup" cache
id: setup-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-setup-icons
- name: Use "dist" cache
id: dist-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-dist-production-icons
- name: Build packages
id: build-packages
run: node_modules/.bin/pnpm run build
- name: log-errors-to-slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()
publish:
name: Publish icons to npm
runs-on: ubuntu-latest
needs: [packages, setup]
steps:
- name: Use "dist" cache
id: dist-cache
uses: actions/cache@v3
with:
path: |
./*
~/.pnpm-store
key: ${{ github.sha }}-dist-production-icons
- name: Publish to npm
id: publish-to-npm
run: |
node_modules/.bin/pnpm config set '//registry.npmjs.org/:_authToken' ${{ secrets.NPM_TOKEN }}
node_modules/.bin/pnpm --filter ./packages/eds-icons publish --access public --no-git-checks --tag ${{ needs.setup.outputs.tag }}
- name: log-errors-to-slack
uses: act10ns/slack@v2
with:
status: ${{ job.status }}
steps: ${{ toJson(steps) }}
if: failure()