This commit is contained in:
Connor Clark 2020-12-09 20:45:19 -06:00 коммит произвёл GitHub
Родитель c2b45b8222
Коммит 25de337597
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 41 добавлений и 9 удалений

13
.github/scripts/bump-nightly-version.sh поставляемый Normal file
Просмотреть файл

@ -0,0 +1,13 @@
#!/usr/bin/env bash
##
# @license Copyright 2020 The Lighthouse Authors. All Rights Reserved.
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
##
set -euxo pipefail
DATE=$(date --date=yesterday '+%Y%m%d')
PATCH=$(node -e "console.log(require('./package.json').version)")
node lighthouse-core/scripts/release/bump-versions.js "$PATCH-dev.$DATE"

1
.github/workflows/devtools.yml поставляемый
Просмотреть файл

@ -24,7 +24,6 @@ jobs:
with:
path: lighthouse
# Caches last ~week, so CI will refresh these dependencies that often.
- name: Cache depot tools, devtools, blink tools and content shell
uses: actions/cache@v2
with:

21
.github/workflows/publish.yml поставляемый Normal file
Просмотреть файл

@ -0,0 +1,21 @@
name: Publish nightly
on:
schedule:
- cron: '0 5 * * *'
workflow_dispatch: {}
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: 12.x
- run: yarn --frozen-lockfile
working-directory: ${{ github.workspace }}/lighthouse
- run: bash $GITHUB_WORKSPACE/.github/scripts/bump-nightly-version.sh
- run: npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

Просмотреть файл

@ -10,11 +10,16 @@ const path = require('path');
const glob = require('glob');
const NEW_VERSION = process.argv[2];
if (!/^\d+\.\d+\.\d+$/.test(NEW_VERSION)) throw new Error('Usage: node bump-versions.json x.x.x');
if (!/^\d+\.\d+\.\d+(-dev\.\d{8})?$/.test(NEW_VERSION)) {
throw new Error('Usage: node bump-versions.json x.x.x');
}
const ignore = [
'**/node_modules/**',
'docs/recipes/auth/package.json',
'changelog.md',
'docs/recipes/auth/package.json',
'docs/recipes/custom-gatherer-puppeteer/package.json',
'docs/recipes/integration-test/package.json',
];
for (const file of glob.sync('**/{package.json,*.md}', {ignore})) {

Просмотреть файл

@ -18,12 +18,6 @@ fi
OLD_VERSION=$(node -e "console.log(require('./package.json').version)")
NEW_VERSION=$1
BRANCH_NAME="bump_$NEW_VERSION"
SEMVER_PATTERN="[0-9]*\.[0-9]*\.[0-9]*"
if [[ $(echo "$NEW_VERSION" | sed 's/[0-9]*\.[0-9]*\.[0-9]*/SECRET_REPLACE/g') != "SECRET_REPLACE" ]]; then
echo "Incorrect version format. Must be x.x.x"
exit 1
fi
if [[ -n "$(git status --porcelain)" ]]; then
echo "Repo has changes to the files! Commit or stash the changes to continue."