-
Notifications
You must be signed in to change notification settings - Fork 2
64 lines (54 loc) · 1.76 KB
/
build-and-deploy.workflow.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
name: Build and Deploy
on:
push:
branches:
- main
jobs:
validate-js:
uses: ./.github/workflows/validate-js.yml
validate-android:
uses: ./.github/workflows/validate-android.yml
validate-ios:
uses: ./.github/workflows/validate-ios.yml
deploy:
runs-on: ubuntu-latest
needs: [validate-js, validate-android, validate-ios]
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR: ${{ secrets.GIT_AUTHOR }}
GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
steps:
- name: Checkout git repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: 16
cache: yarn
- name: Install dependencies
run: |
npm install -g yarn
yarn install --frozen-lockfile --ignore-engines
- name: Build package
run: yarn prepack
- name: Authenticate with NPM Registry
run: npm config set //registry.npmjs.org/:_authToken ${NPM_TOKEN}
- name: Set package as public
run: npm config set access public
- name: Set git config ability to create commits
run: |
git config user.name "${GIT_AUTHOR}"
git config user.email "${GIT_AUTHOR_EMAIL}"
- name: Add GitHub to known_hosts
run: |
mkdir ~/.ssh
touch ~/.ssh/known_hosts
ssh-keyscan github.com >> ~/.ssh/known_hosts
- name: Publish package
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
yarn run release -- --ci --no-git.requireCleanWorkingDir