-
Notifications
You must be signed in to change notification settings - Fork 4
59 lines (51 loc) · 1.69 KB
/
publish.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
---
name: publish
on:
push:
branches:
- alpha
- beta
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
token: ${{secrets.gh_token}}
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: "https://registry.npmjs.org"
- name: Get cache directory
id: yarn-cache-dir
run: |
echo "::set-output name=dir::$(yarn cache dir)"
- name: Restoring cache
uses: actions/cache@v3
id: yarn-cache # use this to check for `cache-hit` ==> if: steps.yarn-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Packages
# NOTE: The --ignore-scripts flag is required to prevent leakage of NPM_TOKEN value
# See https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#use-private-packages
run: yarn install --frozen-lockfile --prefer-offline --ignore-scripts
- name: Build
run: yarn prepack
# - name: Test
# run: yarn lint
- name: Publish
run: npx semantic-release
env:
NODE_ENV: "cicd"
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
GITHUB_TOKEN: ${{secrets.gh_token}}
GIT_AUTHOR_NAME: "autocloud-deploy-bot"
GIT_AUTHOR_EMAIL: "[email protected]"
GIT_COMMITTER_NAME: "autocloud-deploy-bot"
GIT_COMMITTER_EMAIL: "[email protected]"