-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8228bbe
commit e48a464
Showing
4 changed files
with
86 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Publish compress-nodeks example to release | ||
on: | ||
#push: | ||
# branches: [ master, main ] | ||
release: | ||
types: [published] | ||
jobs: | ||
build: | ||
permissions: | ||
contents: write | ||
packages: write | ||
repository-projects: write | ||
actions: write | ||
deployments: write | ||
checks: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
# Setup .npmrc file to publish to npm | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
# | ||
- name: Set output | ||
id: vars | ||
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT | ||
- name: Check output | ||
env: | ||
RELEASE_VERSION: ${{ steps.vars.outputs.tag }} | ||
run: | | ||
echo $RELEASE_VERSION | ||
echo ${{ steps.vars.outputs.tag }} | ||
# | ||
- run: cd example | ||
- run: ls -l | ||
- run: npm i | ||
- run: npm run prepare | ||
- run: npm run build | ||
# | ||
- name: Zip files for release | ||
run: zip -r compress-nodejs-example-${{ steps.vars.outputs.tag }}.zip dist/ | ||
|
||
- name: Upload Release Asset | ||
uses: actions/upload-release-asset@v1 | ||
with: | ||
upload_url: ${{ github.event.release.upload_url }} | ||
asset_path: ./compress-nodejs-example-${{ steps.vars.outputs.tag }}.zip # Adjust according to your build output directory | ||
asset_name: compress-nodejs-example-${{ steps.vars.outputs.tag }}.zip | ||
asset_content_type: application/zip | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
/* | ||
* | ||
* Author: Allan Nava ([email protected]) | ||
* Author: Allan Nava ([email protected]) | ||
* Author: Antonio Borgese ([email protected]) | ||
* ----- | ||
* Last Modified: | ||
* Modified By: Allan Nava ([email protected]>) | ||
|
@@ -9,7 +10,7 @@ | |
* | ||
*/ | ||
|
||
import { TNGRM_BASE_URL, S3_SPACE, GET_CATEGORIES, PRESIGNED_URL_S3, ADD_VIDEO_THUMB, CREATE_UPLOAD, GET_RUNNING_SINGLE_INSTANCE, GET_RESTREAMERS, GET_RUNNING_INSTANCES, SCALE_RESTREAMER, GET_UPLOADS, GET_SINGLE_UPLOAD, SET_PUBLISHED_UPLOAD, SIGN_S3_URL, GET_JOBID_PROGRESS, CREDENTIALS, BULK_EVENTS_CREATE, RESTREAMER_HLS_START, RESTREAMER_HLS_STOP, RESTREAMER_PUSH_START, RESTREAMER_PUSH_STOP, RESTREAMER_PULL_START, RESTREAMER_PULL_STOP } from "./constants"; | ||
import { TNGRM_BASE_URL, S3_SPACE, GET_CATEGORIES, PRESIGNED_URL_S3, ADD_VIDEO_THUMB, CREATE_UPLOAD, GET_RUNNING_SINGLE_INSTANCE, GET_RESTREAMERS, GET_RUNNING_INSTANCES, SCALE_RESTREAMER, GET_UPLOADS, GET_SINGLE_UPLOAD, SET_PUBLISHED_UPLOAD, SIGN_S3_URL, GET_JOBID_PROGRESS, CREDENTIALS, BULK_EVENTS_CREATE, RESTREAMER_HLS_START, RESTREAMER_HLS_STOP, RESTREAMER_PUSH_START, RESTREAMER_PUSH_STOP, RESTREAMER_PULL_START, RESTREAMER_PULL_STOP, GET_CUSTOMER_ZONE } from "./constants"; | ||
// Import the EvaporateJS library | ||
//import * from 'evaporate'; | ||
// | ||
|
@@ -279,30 +280,6 @@ export class TangramClient { | |
let upload = await this.upload_s3(destination_folder, file, fileName); | ||
console.log("upload ", upload); | ||
return await this.encode(file_dest, file, title, tags, location_place, category_id); | ||
/*return await fetch(TNGRM_BASE_URL + CREATE_UPLOAD, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
api_key: this.api_key, | ||
title: title, | ||
tags: tags, | ||
category: parseInt(category_id), | ||
location: location_place, | ||
filename: file_dest, | ||
size: parseInt(file.size), | ||
reporter_email: `${this.customer_name}@tngrm.io`, | ||
}), | ||
}) | ||
.then((res) => { | ||
if (!res.ok) { | ||
throw new Error( | ||
`something went wrong during create upload, ${res.status} ${res.statusText}` | ||
); | ||
} | ||
return res.json(); | ||
});*/ | ||
// | ||
} | ||
|
||
|
@@ -737,15 +714,33 @@ export class TangramClient { | |
} | ||
return res.json(); | ||
}); | ||
// .then((json_res) => { | ||
// console.log(json_res); | ||
// return json_res.data; | ||
// }) | ||
// .catch((err) => { | ||
// console.log(err); | ||
// }); | ||
} | ||
|
||
|
||
/** | ||
* Need to call before upload s3 | ||
* | ||
* @returns customer_s3 | ||
*/ | ||
async getZone() { | ||
return await fetch(TNGRM_BASE_URL + GET_CUSTOMER_ZONE, { | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
body: JSON.stringify({ | ||
api_key: this.api_key, | ||
client_id: this.client_id, | ||
}) | ||
}).then((res) => { | ||
if (!res.ok) { | ||
throw new Error( | ||
`something went wrong during get getZone, ${res.status} ${res.statusText}` | ||
); | ||
} | ||
return res.json(); | ||
}); | ||
} | ||
/** | ||
* jobid is compulsory | ||
* example: get_single_upload(1000) | ||
|