mirror of
https://github.com/ouchadam/small-talk.git
synced 2024-12-17 20:38:30 +01:00
posting message to matrix room on release upload
This commit is contained in:
parent
ebfcd1f058
commit
9e17f77a75
2
.github/workflows/release-candidate.yml
vendored
2
.github/workflows/release-candidate.yml
vendored
@ -32,8 +32,10 @@ jobs:
|
||||
mkdir .secrets
|
||||
touch .secrets/upload-key.jks
|
||||
touch .secrets/service-account.json
|
||||
touch .secrets/matrix.json
|
||||
echo -n '${{ secrets.UPLOAD_KEY }}' | base64 --decode >> .secrets/upload-key.jks
|
||||
echo -n '${{ secrets.SERVICE_ACCOUNT }}' | base64 --decode >> .secrets/service-account.json
|
||||
echo -n '${{ secrets.MATRIX }}' | base64 --decode >> .secrets/matrix.json
|
||||
|
||||
- name: Assemble release variant
|
||||
run: ./tools/generate-release.sh ${{ secrets.STORE_PASS }}
|
||||
|
@ -6,7 +6,8 @@ const config = {
|
||||
pathToVersionFile: "version.json",
|
||||
rcBranchesFrom: "main",
|
||||
rcMergesTo: "release",
|
||||
packageName: "app.dapk.st"
|
||||
packageName: "app.dapk.st",
|
||||
matrixRoomId: "!jgNenzNPtSpJLjjsxe:matrix.org"
|
||||
}
|
||||
|
||||
const rcBranchName = "release-candidate"
|
||||
|
941
tools/beta-release/package-lock.json
generated
941
tools/beta-release/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -6,6 +6,8 @@
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@googleapis/androidpublisher": "^3.0.0"
|
||||
"@googleapis/androidpublisher": "^3.0.0",
|
||||
"matrix-js-sdk": "^19.4.0",
|
||||
"request": "^2.88.2"
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,13 @@
|
||||
import * as google from '@googleapis/androidpublisher';
|
||||
import * as fs from "fs";
|
||||
import * as http from 'https';
|
||||
import * as url from 'url';
|
||||
import * as google from '@googleapis/androidpublisher'
|
||||
import * as fs from "fs"
|
||||
import * as http from 'https'
|
||||
import matrixcs, * as matrix from 'matrix-js-sdk'
|
||||
import request from 'request'
|
||||
import * as url from 'url'
|
||||
matrixcs.request(request)
|
||||
|
||||
const matrixAuth = JSON.parse(fs.readFileSync('.secrets/matrix.json'))
|
||||
const client = matrix.createClient(matrixAuth)
|
||||
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
|
||||
|
||||
const auth = new google.auth.GoogleAuth({
|
||||
@ -63,6 +68,14 @@ export const release = async (github, version, applicationId, artifacts, config)
|
||||
|
||||
console.log("Promoting beta draft release to live...")
|
||||
await promoteDraftToLive(applicationId)
|
||||
|
||||
const content = {
|
||||
"body": `New release`,
|
||||
"format": "org.matrix.custom.html",
|
||||
"formatted_body": `New release rolling out <a href="${releaseResult.data.url}">${releaseResult.data.tag_name}</a>`,
|
||||
"msgtype": "m.text"
|
||||
}
|
||||
await client.sendEvent(config.matrixRoomId, "m.room.message", content, "")
|
||||
}
|
||||
|
||||
const startPlayRelease = async (applicationId) => {
|
||||
@ -192,4 +205,3 @@ const promoteDraftToLive = async (applicationId) => {
|
||||
packageName: applicationId,
|
||||
}).catch((error) => Promise.reject(error.response.data))
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user