Skip to content

Commit 9a13e29

Browse files
committed
chore: add auto-release
the project is rarely updated, but is used in explore.ipld.io and ipfs-webui, which makes bubbling up complex already. autorelease reduces friction a bit
1 parent a55897b commit 9a13e29

File tree

7 files changed

+47553
-37022
lines changed

7 files changed

+47553
-37022
lines changed

.github/workflows/automerge.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Automatically merge pull requests opened by web3-bot, as soon as (and only if) all tests pass.
2+
# This reduces the friction associated with updating with our workflows.
3+
4+
on: [ pull_request ]
5+
name: Automerge
6+
7+
jobs:
8+
automerge-check:
9+
if: github.event.pull_request.user.login == 'web3-bot'
10+
runs-on: ubuntu-latest
11+
outputs:
12+
status: ${{ steps.should-automerge.outputs.status }}
13+
steps:
14+
- uses: actions/checkout@v2
15+
with:
16+
fetch-depth: 0
17+
- name: Check if we should automerge
18+
id: should-automerge
19+
run: |
20+
for commit in $(git rev-list --first-parent origin/${{ github.event.pull_request.base.ref }}..${{ github.event.pull_request.head.sha }}); do
21+
committer=$(git show --format=$'%ce' -s $commit)
22+
echo "Committer: $committer"
23+
if [[ "$committer" != "[email protected]" ]]; then
24+
echo "Commit $commit wasn't committed by web3-bot, but by $committer."
25+
echo "::set-output name=status::false"
26+
exit
27+
fi
28+
done
29+
echo "::set-output name=status::true"
30+
automerge:
31+
needs: automerge-check
32+
runs-on: ubuntu-latest
33+
# The check for the user is redundant here, as this job depends on the automerge-check job,
34+
# but it prevents this job from spinning up, just to be skipped shortly after.
35+
if: github.event.pull_request.user.login == 'web3-bot' && needs.automerge-check.outputs.status == 'true'
36+
steps:
37+
- name: Wait on tests
38+
uses: lewagon/wait-on-check-action@bafe56a6863672c681c3cf671f5e10b20abf2eaa # v0.2
39+
with:
40+
ref: ${{ github.event.pull_request.head.sha }}
41+
repo-token: ${{ secrets.GITHUB_TOKEN }}
42+
wait-interval: 10
43+
running-workflow-name: 'automerge' # the name of this job
44+
- name: Merge PR
45+
uses: pascalgn/automerge-action@741c311a47881be9625932b0a0de1b0937aab1ae # v0.13.1
46+
env:
47+
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48+
MERGE_LABELS: ""
49+
MERGE_METHOD: "squash"
50+
MERGE_DELETE_BRANCH: true
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: test & maybe release
2+
on:
3+
push:
4+
branches:
5+
- master # with #262 - ${{{ github.default_branch }}}
6+
pull_request:
7+
branches:
8+
- master # with #262 - ${{{ github.default_branch }}}
9+
10+
jobs:
11+
12+
check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: actions/setup-node@v2
17+
with:
18+
node-version: lts/*
19+
- uses: ipfs/aegir/actions/cache-node-modules@master
20+
- run: npm run --if-present build
21+
- run: npm run --if-present storybook:build
22+
- run: npm run --if-present test
23+
- run: npm run --if-present lint
24+
- run: npm run --if-present dep-check
25+
26+
release:
27+
needs: [check]
28+
runs-on: ubuntu-latest
29+
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
fetch-depth: 0
34+
- uses: actions/setup-node@v2
35+
with:
36+
node-version: lts/*
37+
- uses: ipfs/aegir/actions/cache-node-modules@master
38+
- uses: ipfs/aegir/actions/docker-login@master
39+
with:
40+
docker-token: ${{ secrets.DOCKER_TOKEN }}
41+
docker-username: ${{ secrets.DOCKER_USERNAME }}
42+
- run: npm run --if-present release
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

LICENSE

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
1-
MIT License
1+
This project is dual licensed under MIT and Apache-2.0.
22

3-
Copyright (c) 2018 Protocol Labs
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
3+
MIT: https://www.opensource.org/licenses/mit
4+
Apache-2.0: https://www.apache.org/licenses/license-2.0

LICENSE-APACHE

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
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
2+
3+
http://www.apache.org/licenses/LICENSE-2.0
4+
5+
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.

LICENSE-MIT

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
The MIT License (MIT)
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy
4+
of this software and associated documentation files (the "Software"), to deal
5+
in the Software without restriction, including without limitation the rights
6+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7+
copies of the Software, and to permit persons to whom the Software is
8+
furnished to do so, subject to the following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in
11+
all copies or substantial portions of the Software.
12+
13+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19+
THE SOFTWARE.

0 commit comments

Comments
 (0)