This repository has been archived by the owner on Feb 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (69 loc) · 2.47 KB
/
ci.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
name: "Lint and Publish Updated Packages"
on:
push:
branches:
- master
pull_request:
types:
- opened
- synchronize
- reopened
- labeled
workflow_dispatch:
inputs:
publish:
type: boolean
default: false
description: "Run package publisher"
jobs:
lint:
name: Lint Packages
runs-on: ubuntu-latest
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Setup node auth and module cache
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "19.x"
registry-url: "https://npm.pkg.github.com"
- name: Install Dependencies
run: yarn
- name: Lint all Packages
run: yarn lint
publish:
name: Publish Updated Packages
runs-on: ubuntu-latest
permissions:
packages: write
contents: write
needs: [lint]
concurrency:
group: ${{ github.workflow }}-publish-${{ github.ref }}
cancel-in-progress: true
if: ${{ (github.event_name == 'push' && github.ref_type == 'branch' && github.ref_name == 'master') || (github.event_name == 'workflow_dispatch' && inputs.publish) }}
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
# Magic number (0x7fffffff) that tells git to fetch the entire history for just this ref, actions/checkout@v3 fetches all extraneous branches with depth 0
fetch-depth: 2147483647
- name: Set Git Author Credentials
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
- name: Setup node auth and module cache
uses: actions/setup-node@v3
with:
cache: "yarn"
node-version: "19.x"
registry-url: "https://npm.pkg.github.com"
- name: Install Dependencies
run: yarn
- name: Check for and publish updated packages
run: yarn ci:publisher