File tree Expand file tree Collapse file tree 4 files changed +62
-14
lines changed
Expand file tree Collapse file tree 4 files changed +62
-14
lines changed Original file line number Diff line number Diff line change 1+ name : Tag, Release, Publish
2+
3+ on :
4+ push :
5+ branches :
6+ - master
7+
8+ jobs :
9+ publish :
10+ name : Deploy
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+
15+ - name : Tag
16+ id : autotagger
17+ uses : butlerlogic/action-autotag@stable
18+ with :
19+ GITHUB_TOKEN : " ${{ secrets.GITHUB_TOKEN }}"
20+
21+ - name : Pre-release
22+ if : steps.autotagger.outputs.tagname != ''
23+ run : |
24+ if [[ "${{ steps.autotagger.output.version }}" == *"-"* ]]; then echo "::set-env IS_PRERELEASE=true";else echo "::set-env IS_PRERELEASE=''";fi
25+
26+ - name : Release
27+ id : release
28+ if : steps.autotagger.outputs.tagname != ''
29+ uses : actions/create-release@v1.0.0
30+ env :
31+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
32+ with :
33+ tag_name : ${{ steps.autotagger.outputs.tagname }}
34+ release_name : Version ${{ steps.autotagger.outputs.version }}
35+ body : ${{ steps.autotagger.outputs.tagmessage }}
36+ draft : false
37+ prerelease : env.IS_PRERELEASE != ''
38+
39+ - name : Publish
40+ id : publish
41+ if : steps.autotagger.outputs.tagname != ''
42+ uses : author/action-publish@master
43+ env :
44+ REGISTRY_TOKEN : ${{ secrets.REGISTRY_TOKEN }}
45+ ACTIONS_STEP_DEBUG : true
46+
47+ - name : Rollback
48+ if : failure()
49+ uses : author/action-rollback@stable
50+ with :
51+ release_id : ${{ steps.release.outputs.id }}
52+ env :
53+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ switch (cmd.trim().toLowerCase()) {
2929
3030 pkg . scripts = pkg . scripts || { }
3131 pkg . scripts = Object . assign ( pkg . scripts , {
32- serve : 'firebase serve --only functions,database ' ,
32+ serve : 'firebase serve --only functions' ,
3333 shell : 'firebase functions:shell' ,
3434 start : 'firebase emulators:start --only functions' ,
3535 logs : 'firebase functions:log' ,
@@ -121,7 +121,7 @@ Object.assign(exports, FirebaseAPI.exports)
121121
122122 if ( ! fs . existsSync ( path . join ( apiPath , 'routes.js' ) ) ) {
123123 fs . writeFileSync ( path . join ( apiPath , 'routes.js' ) , `const express = require('express')
124- const API = require('@butlerlogic/firebase -api').API // Reference to @ecor/common-api module.
124+ const API = require('@butlerlogic/common -api')
125125const app = express()
126126
127127API.applySimpleCORS(app)
Original file line number Diff line number Diff line change @@ -12,12 +12,12 @@ class API {
1212 let content = require ( process . env . GOOGLE_APPLICATION_CREDENTIALS )
1313
1414 if ( content . private_key . trim ( ) . indexOf ( '-----BEGIN PRIVATE KEY-----' ) !== 0 ) {
15+ console . log ( `PRIVATE KEY NOT FOUND IN ${ process . env . GOOGLE_APPLICATION_CREDENTIALS } .\nFirebase admin connection may be invalid without proper credentials.\n\n` )
1516 delete process . env . GOOGLE_APPLICATION_CREDENTIALS
16- console . log ( '\n\nPRIVATE KEY NOT FOUND.\nFirebase admin connection may be invalid without proper credentials.\n\n' )
1717 }
1818 } catch ( e ) {
19+ console . log ( `PRIVATE KEY NOT FOUND IN ${ process . env . GOOGLE_APPLICATION_CREDENTIALS } .\nFirebase admin connection may be invalid without proper credentials.\n\n` )
1920 delete process . env . GOOGLE_APPLICATION_CREDENTIALS
20- console . log ( '\n\nPRIVATE KEY NOT FOUND.\nFirebase admin connection may be invalid without proper credentials.\n\n' )
2121 }
2222 }
2323 }
@@ -49,10 +49,6 @@ class API {
4949
5050 return exportable
5151 }
52-
53- get API ( ) {
54- return require ( '@ecor/common-api' )
55- }
5652}
5753
5854module . exports = new API ( )
Original file line number Diff line number Diff line change 11{
22 "name" : " @butlerlogic/firebase-api" ,
3- "version" : " 1.0.9-beta.1 " ,
3+ "version" : " 1.0.9" ,
44 "description" : " A boilerplate structure for building an HTTP API using Firebase functions." ,
55 "main" : " index.js" ,
66 "scripts" : {
3030 },
3131 "homepage" : " https://github.com/ButlerLogic/firebase-api#readme" ,
3232 "dependencies" : {
33- "@ecor/common-api" : " ^1.0.6" ,
34- "firebase-admin" : " ^8.5.0" ,
35- "firebase-functions" : " ^3.2.0" ,
36- "localenvironment" : " ^1.0.2" ,
37- "@butlerlogic/firebase" : " ^1.0.0"
33+ "firebase-admin" : " 8.9.2" ,
34+ "firebase-functions" : " 3.3.0" ,
35+ "localenvironment" : " 1.1.0" ,
36+ "@butlerlogic/firebase" : " 1.0.1"
3837 }
3938}
You can’t perform that action at this time.
0 commit comments