Skip to content

Commit 2dac87c

Browse files
authored
Merge pull request #80 from dependabot/backport-v1.0.0-release-notes-to-v1
Backport v1.0.0 release notes to v1
2 parents 2a540eb + 09487cb commit 2dac87c

File tree

5 files changed

+86
-2
lines changed

5 files changed

+86
-2
lines changed

.github/workflows/check-dist.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Check dist
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- 'releases/*'
9+
10+
jobs:
11+
verify-build: # make sure the checked in dist/ folder matches the output of a rebuild
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
with:
17+
ref: ${{ github.event.pull_request.head.sha }}
18+
19+
- name: Read .nvmrc
20+
id: nvm
21+
run: echo ::set-output name=NVMRC::$(cat .nvmrc)
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v1
25+
with:
26+
node-version: ${{ steps.nvm.outputs.NVMRC }}
27+
28+
- name: Install NPM dependencies
29+
run: npm ci
30+
31+
- name: Rebuild the dist/ directory
32+
run: npm run package
33+
34+
- name: Compare the expected and actual dist/ directories
35+
run: script/check-diff
36+
verify-index-js: # make sure the entrypoint js files run on a clean machine without compiling first
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v2
40+
with:
41+
ref: ${{ github.event.pull_request.head.sha }}
42+
43+
- uses: ./
44+
with:
45+
milliseconds: 1000

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "dependabot-updater-action",
3-
"version": "0.0.0",
3+
"version": "1.0.0",
44
"private": true,
55
"description": "Runs Dependabot workloads via GitHub Actions.",
66
"main": "src/main.ts",

script/bump-version

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
usage() { echo "Usage: $0 -p [major | minor | patch]" 1>&2; exit 1; }
4+
5+
while getopts "p:" o; do
6+
case "${o}" in
7+
p)
8+
patch_level=${OPTARG}
9+
(( patch_level == 'major' || patch_level == 'minor' || patch_level == 'patch'))
10+
;;
11+
*)
12+
usage
13+
;;
14+
esac
15+
done
16+
17+
echo "$patch_level"
18+
19+
if [[ -z "${patch_level}" ]]; then
20+
usage
21+
fi
22+
23+
new_version=$(npm version "${patch_level}" --no-git-tag-version)
24+
git checkout -b "${new_version}"-release-notes
25+
git add package.json package-lock.json
26+
git commit -m "${new_version}"
27+
28+
echo "Branch prepared for ${new_version}"

script/check-diff

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
# Make sure we notice any untracked files generated by the build
4+
git add --intent-to-add .
5+
git diff --quiet dist/
6+
retVal=$?
7+
if [ $retVal -ne 0 ]; then
8+
echo "Detected uncommitted changes after build:"
9+
git --no-pager diff dist/
10+
exit 1
11+
fi

0 commit comments

Comments
 (0)