-
Notifications
You must be signed in to change notification settings - Fork 22
96 lines (84 loc) · 3.06 KB
/
release-extension.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Extension release workflow
on:
push:
tags:
- "v*.*.*"
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04 #orai-self-hosted
strategy:
matrix:
node-version: [18.17.0]
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
- name: Checkout to Project
uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
# - uses: sonarsource/sonarqube-scan-action@master
# env:
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
# SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- uses: actions/cache@v2
id: yarn-cache
with:
path: |
${{ steps.yarn-cache-dir-path.outputs.dir }}
./node_modules/
key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install Dependencies
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile
- name: Install extension packages
working-directory: apps/extension
run: yarn --silent
- name: Build Libs
run: yarn build:libs
- name: Build extension
working-directory: apps/extension
run: yarn build
env:
REACT_APP_MIX_PANEL_TOKEN: ${{ secrets.MIX_PANEL_TOKEN }}
- name: Publish extension for test
env:
GITHUB_TOKEN: ${{ secrets.PAT }}
REF_NAME: ${{ github.ref_name }}
run: |
chmod 777 -R ./scripts
./scripts/release.sh
- name: Upload & release
uses: mnao305/chrome-extension-upload@v4.0.1
if: ${{ (env.PRERELEASE == '') }}
with:
file-path: apps/extension/owallet-extension-${{ github.ref_name }}.zip
extension-id: ${{ secrets.EXT_ID }}
client-id: ${{ secrets.EXT_CLIENT_ID }}
client-secret: ${{ secrets.EXT_CLIENT_SECRET }}
refresh-token: ${{ secrets.EXT_REFRESH_TOKEN }}
publish: false
- name: Send discord message
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
username: "GitBot"
message: Extension released successe! comment=${{ github.event.head_commit.message }}
- name: Send discord message
if: ${{ failure() }}
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.DISCORD_WEBHOOK_ID }}
webhook_token: ${{ secrets.DISCORD_WEBHOOK_TOKEN }}
username: "GitBot"
message: Extension released fail! ${{ github.job }} job in worflow ${{ github.workflow }} of ${{ github.repository }} has ${{ job.status }}