зеркало из https://github.com/electron/releases.git
chore: Test and update via Actions (#42)
This commit is contained in:
Родитель
5e30beac5e
Коммит
7d1b77e433
|
@ -1 +1 @@
|
|||
GITHUB_AUTH_TOKEN=df09c7ee4a81d0cbfc128201baee5f2da2a3ae94
|
||||
GH_TOKEN=
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
workflow "Update and release" {
|
||||
on = "schedule(0 * * * *)"
|
||||
resolves = ["Update data and release"]
|
||||
}
|
||||
|
||||
action "Update data and release" {
|
||||
uses = "actions/npm@master"
|
||||
args = "run release"
|
||||
secrets = [
|
||||
"GH_TOKEN",
|
||||
"NPM_AUTH_TOKEN",
|
||||
]
|
||||
}
|
||||
|
||||
workflow "Test" {
|
||||
on = "push"
|
||||
resolves = ["Run tests"]
|
||||
}
|
||||
|
||||
action "Install dependencies" {
|
||||
uses = "actions/npm@master"
|
||||
args = "ci"
|
||||
}
|
||||
|
||||
action "Run tests" {
|
||||
uses = "actions/npm@master"
|
||||
needs = ["Install dependencies"]
|
||||
args = "test"
|
||||
}
|
|
@ -1,8 +0,0 @@
|
|||
language: node_js
|
||||
node_js:
|
||||
- '8'
|
||||
- '10'
|
||||
install:
|
||||
- npm ci
|
||||
script:
|
||||
- npm run build && npm test
|
|
@ -1,7 +1,9 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
require('make-promises-safe')
|
||||
require('dotenv-safe').load()
|
||||
if (!process.env.GH_TOKEN) {
|
||||
require('dotenv-safe').load()
|
||||
}
|
||||
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
@ -18,7 +20,7 @@ const firstNpmVersion = '1.3.1'
|
|||
|
||||
github.authenticate({
|
||||
type: 'token',
|
||||
token: process.env.GITHUB_AUTH_TOKEN
|
||||
token: process.env.GH_TOKEN
|
||||
})
|
||||
|
||||
main()
|
||||
|
|
|
@ -1,20 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -x # print commands before execution
|
||||
set -v # print commands before execution, but don't expand env vars in output
|
||||
set -o errexit # always exit on error
|
||||
set -o pipefail # honor exit codes when piping
|
||||
set -o nounset # fail on unset variables
|
||||
|
||||
git clone "https://github.com/electron/electron-releases" module
|
||||
git clone "https://electron-bot:$GH_TOKEN@github.com/electron/releases" module
|
||||
cd module
|
||||
npm install
|
||||
npm ci
|
||||
|
||||
npm run build
|
||||
npm test
|
||||
[[ `git status --porcelain` ]] || exit
|
||||
git add .
|
||||
|
||||
# bail if nothing changed
|
||||
if [ "$(git status --porcelain)" = "" ]; then
|
||||
echo "no new content found; goodbye!"
|
||||
exit
|
||||
fi
|
||||
|
||||
git config user.email electron@github.com
|
||||
git config user.name electron-bot
|
||||
git add .
|
||||
git commit -am "update electron-releases"
|
||||
npm version minor -m "bump minor to %s"
|
||||
git push origin master --follow-tags
|
||||
npm publish
|
||||
npm publish
|
||||
|
|
Загрузка…
Ссылка в новой задаче