-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add untested automatic update script
- Loading branch information
1 parent
006fcb8
commit f89e04c
Showing
3 changed files
with
150 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
name: Update Dependencies, Test, and Commit | ||
|
||
# Continuously update dependencies of this package and test with all versions of node on various OSes | ||
|
||
on: | ||
schedule: | ||
# Every Saturday at 5:00am | ||
- cron: 0 5 * * 6 | ||
|
||
jobs: | ||
update: | ||
runs-on: ubuntu-latest | ||
name: Update Dependencies | ||
steps: | ||
- name: Enable color for Npm output | ||
run: echo color = always >> .npmrc | ||
|
||
- name: Checkout latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: master | ||
fetch-depth: 0 | ||
|
||
- name: Install Node | ||
uses: actions/setup-node@v2 | ||
|
||
- name: 'Debug: Node version' | ||
run: node --version | ||
|
||
# Update all dependencies | ||
- name: 'Update dependencies' | ||
run: npx npm-check-updates -u --packageManager yarn | ||
env: | ||
FORCE_COLOR: 1 | ||
|
||
# Install dependencies and Build | ||
- name: Install dependencies and Build (using `yarn install`) | ||
run: yarn install | ||
|
||
- name: 'Info: Show differences' | ||
run: git diff --color=always | ||
|
||
- name: Clean touched but identical files | ||
run: 'git update-index --refresh || :' | ||
|
||
- name: Test for changes (don't continue if there aren't any) | ||
id: changes | ||
run: '! git diff-index --quiet HEAD --' | ||
|
||
# TODO: bail out "successfully" here instead of as "error" | ||
- name: Switch to update branch | ||
run: git checkout -b npm-check-updates | ||
|
||
- name: Add expected file changes | ||
run: git add package.json yarn.lock | ||
|
||
- name: Set Author | ||
run: | | ||
git config user.email actions@github.com | ||
git config user.name GitHub Actions | ||
- name: 'Commit changes' | ||
run: git commit -m 'Automatic dependency update' | ||
|
||
- name: Test for dangling changes (error if any remain!) | ||
run: git diff-index --quiet HEAD -- | ||
|
||
- name: Push to GitHub | ||
run: git push origin npm-check-updates --force | ||
|
||
test-matrix: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
node: [6, 7, 8, 9, 10, 11, 12, 13, 14, 15] # There are problems on various architectures on lower versions that are more work to fix. Please open an issue if you need more version support | ||
|
||
runs-on: ${{ matrix.os }} | ||
|
||
needs: update | ||
|
||
name: Test with Node ${{ matrix.node }} on ${{ matrix.os }} | ||
|
||
steps: | ||
- name: Enable color for Npm output | ||
run: echo color = always >> .npmrc | ||
|
||
- name: Checkout latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: npm-check-updates | ||
|
||
- name: Install Node ${{ matrix.node }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node }} | ||
|
||
- name: 'Debug: Node version' | ||
run: node --version | ||
|
||
# Install dependencies and Build | ||
- name: Install dependencies and Build (using `yarn install --frozen-lockfile`) | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: 'Info: Show differences' | ||
run: git diff --color=always | ||
|
||
- name: Test Code | ||
run: yarn test --ci | ||
|
||
merge: | ||
name: 'Merge updates into master' | ||
|
||
needs: test-matrix | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Enable color for Npm output | ||
run: echo color = always >> .npmrc | ||
|
||
- name: Checkout latest code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
ref: master | ||
|
||
- name: Merge | ||
run: git merge --ff-only origin/npm-check-updates | ||
|
||
- name: Set Author | ||
run: | | ||
git config user.email actions@github.com | ||
git config user.name GitHub Actions | ||
- name: Bump Version | ||
run: yarn version --patch | ||
|
||
- name: Push | ||
run: git push --tags --atomic origin master | ||
|
||
- name: Cleanup | ||
run: git branch -d origin/npm-check-updates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters