Fix some remaining links to old repository
This commit is contained in:
parent
e7e1c87c59
commit
5adf5942d7
|
@ -9,7 +9,7 @@ jobs:
|
|||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: '/home/runner/work/codemirror/codemirror/node_modules'
|
||||
path: '/home/runner/work/codemirror/codemirror5/node_modules'
|
||||
key: ${{ runner.os }}-modules
|
||||
|
||||
- run: npm install
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# CodeMirror
|
||||
|
||||
[![Build Status](https://github.com/codemirror/codemirror5/workflows/main/badge.svg)](https://github.com/codemirror/codemirror/actions)
|
||||
[![Build Status](https://github.com/codemirror/codemirror5/workflows/main/badge.svg)](https://github.com/codemirror/codemirror5/actions)
|
||||
[![NPM version](https://img.shields.io/npm/v/codemirror.svg)](https://www.npmjs.org/package/codemirror)
|
||||
|
||||
CodeMirror is a versatile text editor implemented in JavaScript for
|
||||
|
|
|
@ -2,34 +2,43 @@
|
|||
|
||||
let version = process.argv[2]
|
||||
let auth = process.argv[3]
|
||||
let url = require("url")
|
||||
|
||||
if (!auth) {
|
||||
console.log("Usage: upload-release.js [TAG] [github-user:password]")
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
function post(host, path, body) {
|
||||
let req = require("https").request({
|
||||
host,
|
||||
auth: auth,
|
||||
headers: {"user-agent": "Release uploader"},
|
||||
path,
|
||||
method: "POST"
|
||||
}, res => {
|
||||
if (res.statusCode >= 300 && res.statusCode < 400) {
|
||||
console.log(res.headers.location)
|
||||
let parsed = url.parse(res.headers.location)
|
||||
post(parsed.host, parsed.path, body)
|
||||
} else if (res.statusCode >= 400) {
|
||||
console.error(res.statusCode, res.statusMessage)
|
||||
res.on("data", d => console.log(d.toString()))
|
||||
res.on("end", process.exit(1))
|
||||
}
|
||||
})
|
||||
req.write(body)
|
||||
req.end()
|
||||
}
|
||||
|
||||
require('child_process').exec("git --no-pager show -s --format='%s' " + version, (error, stdout) => {
|
||||
if (error) throw error
|
||||
let message = stdout.split("\n").slice(2)
|
||||
message = message.slice(0, message.indexOf("-----BEGIN PGP SIGNATURE-----")).join("\n")
|
||||
|
||||
let req = require("https").request({
|
||||
host: "api.github.com",
|
||||
auth: auth,
|
||||
headers: {"user-agent": "Release uploader"},
|
||||
path: "/repos/codemirror/codemirror/releases",
|
||||
method: "POST"
|
||||
}, res => {
|
||||
if (res.statusCode >= 300) {
|
||||
console.error(res.statusMessage)
|
||||
res.on("data", d => console.log(d.toString()))
|
||||
res.on("end", process.exit(1))
|
||||
}
|
||||
})
|
||||
req.write(JSON.stringify({
|
||||
post("api.github.com", "/repos/codemirror/codemirror5/releases", JSON.stringify({
|
||||
tag_name: version,
|
||||
name: version,
|
||||
body: message
|
||||
}))
|
||||
req.end()
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue