Commit abbc527 1 parent f9c0d96 commit abbc527 Copy full SHA for abbc527
File tree 7 files changed +116
-0
lines changed
7 files changed +116
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Build & Deploy Uplim Kun Monitoring
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ paths :
8
+ - packages/triplate-line/**
9
+ workflow_dispatch :
10
+
11
+ jobs :
12
+ deploy :
13
+ runs-on : ubuntu-22.04
14
+ timeout-minutes : 15
15
+ steps :
16
+ - name : Checkout
17
+ uses : actions/checkout@v4
18
+
19
+ - name : Setup Node.js 20.11.0
20
+ uses : actions/setup-node@v4
21
+ with :
22
+ node-version : ' 20.11.0'
23
+
24
+ - name : Install Packages
25
+ run : |
26
+ corepack enable
27
+ yarn workspaces focus triplate-line
28
+
29
+ - name : Create .clasprc.json
30
+ run : |
31
+ echo "${{ secrets.UPLIM_INFO_BASE64 }}" | base64 --decode > ~/.clasprc.json
32
+
33
+ - name : Create .clasp.json
34
+ run : |
35
+ cat > ./packages/triplate-line/.clasp.json <<EOF
36
+ {
37
+ "scriptId": "${{ secrets.TRIPLATE_LINE_SCRIPT_ID }}",
38
+ "rootDir": "./dist"
39
+ }
40
+ EOF
41
+
42
+ - name : Build & Deploy
43
+ run : |
44
+ yarn workspace triplate-line push
Original file line number Diff line number Diff line change
1
+ {
2
+ "timeZone" : " Asia/Tokyo" ,
3
+ "dependencies" : {},
4
+ "exceptionLogging" : " STACKDRIVER" ,
5
+ "runtimeVersion" : " V8" ,
6
+ "oauthScopes" : [" https://www.googleapis.com/auth/script.external_request" ]
7
+ }
Original file line number Diff line number Diff line change
1
+ const { GasPlugin } = require ( "esbuild-gas-plugin" ) ;
2
+
3
+ require ( "esbuild" )
4
+ . build ( {
5
+ entryPoints : [ "src/main.ts" ] ,
6
+ bundle : true ,
7
+ outfile : "dist/main.js" ,
8
+ plugins : [ GasPlugin ] ,
9
+ } )
10
+ . catch ( ( ) => process . exit ( 1 ) ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " triplate-line" ,
3
+ "version" : " 0.0.0" ,
4
+ "scripts" : {
5
+ "build" : " node build.js && cp appsscript.json dist/" ,
6
+ "push" : " yarn build && clasp push"
7
+ },
8
+ "devDependencies" : {
9
+ "@google/clasp" : " 2.4.2" ,
10
+ "@types/google-apps-script" : " 1.0.77" ,
11
+ "esbuild" : " 0.19.6" ,
12
+ "esbuild-gas-plugin" : " 0.8.0"
13
+ },
14
+ "dependencies" : {
15
+ "utils" : " workspace:*"
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ import { postMessage } from "utils" ;
2
+
3
+ function doPost ( e : GoogleAppsScript . Events . DoPost ) {
4
+ const postData = JSON . parse ( e . postData . contents ) . events [ 0 ] ;
5
+ const lineMessageText = postData . message . text ;
6
+
7
+ postMessage ( {
8
+ username : "LINE Bot" ,
9
+ parse : "full" ,
10
+ avatar_url :
11
+ "https://cdn.discordapp.com/attachments/792765244040675389/921661726863282176/pngegg.png" ,
12
+ content : JSON . stringify ( lineMessageText ) ,
13
+ } ) ;
14
+
15
+ return ContentService . createTextOutput (
16
+ JSON . stringify ( {
17
+ message : "Message received" ,
18
+ } ) ,
19
+ ) . setMimeType ( ContentService . MimeType . JSON ) ;
20
+ }
21
+
22
+ declare const global : Record <
23
+ string ,
24
+ ( e : GoogleAppsScript . Events . DoPost ) => void
25
+ > ;
26
+ global . doPost = doPost ;
Original file line number Diff line number Diff line change @@ -3724,6 +3724,18 @@ __metadata:
3724
3724
languageName : unknown
3725
3725
linkType : soft
3726
3726
3727
+ " triplate-line@workspace:packages/triplate-line " :
3728
+ version : 0.0.0-use.local
3729
+ resolution : " triplate-line@workspace:packages/triplate-line"
3730
+ dependencies :
3731
+ " @google/clasp " : " npm:2.4.2"
3732
+ " @types/google-apps-script " : " npm:1.0.77"
3733
+ esbuild : " npm:0.19.6"
3734
+ esbuild-gas-plugin : " npm:0.8.0"
3735
+ utils : " workspace:*"
3736
+ languageName : unknown
3737
+ linkType : soft
3738
+
3727
3739
" ts2gas@npm:^4.2.0 " :
3728
3740
version : 4.2.0
3729
3741
resolution : " ts2gas@npm:4.2.0"
You can’t perform that action at this time.
0 commit comments