-
Notifications
You must be signed in to change notification settings - Fork 3
55 lines (47 loc) · 1.35 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
name: Main CI
on:
workflow_dispatch:
inputs:
distTag:
description: "Dist tag to publish"
required: true
default: "latest"
pull_request:
push:
branches:
- "main"
jobs:
build_and_testing:
runs-on: ubuntu-latest
if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]')"
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-node@v4
with:
always-auth: true
cache: "yarn"
node-version: 20
- name: Creates local .npmrc
if: ${{github.event.inputs.distTag == 'latest'}}
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install
run: yarn install --frozen-lockfile
- name: Check Prettier Formatting
run: yarn prettier:check
- name: Build & Testing
run: |
yarn build
yarn test
- name: Release
if: ${{github.event.inputs.distTag == 'latest'}}
run: |
git config --global user.email "[email protected]"
git config --global user.name "Lingui CI"
npm run release