Skip to content

Commit d55e443

Browse files
committed
Merge branch 'master' into feat/refresh-context
2 parents c17cf2f + 8000dd9 commit d55e443

23 files changed

+352
-144
lines changed

.github/assert-contributors.sh renamed to .github/generate-authors.sh

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
set -e
1313

1414
SCRIPT_PATH=$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )
15+
AUTHORS_PATH="$GITHUB_WORKSPACE/AUTHORS.txt"
1516

1617
if [ -f ${SCRIPT_PATH}/.ci.conf ]
1718
then
@@ -21,18 +22,18 @@ fi
2122
#
2223
# DO NOT EDIT THIS
2324
#
24-
EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot')
25+
EXCLUDED_CONTRIBUTORS+=('John R. Bradley' 'renovate[bot]' 'Renovate Bot' 'Pion Bot' 'pionbot')
2526
# If you want to exclude a name from all repositories, send a PR to
2627
# https://github.com/pion/.goassets instead of this repository.
2728
# If you want to exclude a name only from this repository,
2829
# add EXCLUDED_CONTRIBUTORS=('name') to .github/.ci.conf
2930

30-
MISSING_CONTRIBUTORS=()
31+
CONTRIBUTORS=()
3132

3233
shouldBeIncluded () {
3334
for i in "${EXCLUDED_CONTRIBUTORS[@]}"
3435
do
35-
if [ "$i" == "$1" ] ; then
36+
if [[ $1 =~ "$i" ]]; then
3637
return 1
3738
fi
3839
done
@@ -41,21 +42,25 @@ shouldBeIncluded () {
4142

4243

4344
IFS=$'\n' #Only split on newline
44-
for contributor in $(git log --format='%aN' | sort -u)
45+
for contributor in $(git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf)
4546
do
4647
if shouldBeIncluded $contributor; then
47-
if ! grep -q "$contributor" "$SCRIPT_PATH/../README.md"; then
48-
MISSING_CONTRIBUTORS+=("$contributor")
49-
fi
48+
CONTRIBUTORS+=("$contributor")
5049
fi
5150
done
5251
unset IFS
5352

54-
if [ ${#MISSING_CONTRIBUTORS[@]} -ne 0 ]; then
55-
echo "Please add the following contributors to the README"
56-
for i in "${MISSING_CONTRIBUTORS[@]}"
53+
if [ ${#CONTRIBUTORS[@]} -ne 0 ]; then
54+
cat >$AUTHORS_PATH <<-'EOH'
55+
# Thank you to everyone that made Pion possible. If you are interested in contributing
56+
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
57+
#
58+
# This file is auto generated, using git to list all individuals contributors.
59+
# see `.github/generate-authors.sh` for the scripting
60+
EOH
61+
for i in "${CONTRIBUTORS[@]}"
5762
do
58-
echo "$i"
63+
echo "$i" >> $AUTHORS_PATH
5964
done
60-
exit 1
65+
exit 0
6166
fi

.github/hooks/pre-push.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
set -e
1010

11-
.github/assert-contributors.sh
11+
.github/generate-authors.sh
1212

1313
exit 0
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# DO NOT EDIT THIS FILE
3+
#
4+
# It is automatically copied from https://github.com/pion/.goassets repository.
5+
# If this repository should have package specific CI config,
6+
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
7+
#
8+
# If you want to update the shared CI config, send a PR to
9+
# https://github.com/pion/.goassets instead of this repository.
10+
#
11+
12+
name: generate-authors
13+
14+
on:
15+
pull_request:
16+
17+
jobs:
18+
checksecret:
19+
runs-on: ubuntu-latest
20+
outputs:
21+
is_PIONBOT_PRIVATE_KEY_set: ${{ steps.checksecret_job.outputs.is_PIONBOT_PRIVATE_KEY_set }}
22+
steps:
23+
- id: checksecret_job
24+
env:
25+
PIONBOT_PRIVATE_KEY: ${{ secrets.PIONBOT_PRIVATE_KEY }}
26+
run: |
27+
echo "is_PIONBOT_PRIVATE_KEY_set: ${{ env.PIONBOT_PRIVATE_KEY != '' }}"
28+
echo "::set-output name=is_PIONBOT_PRIVATE_KEY_set::${{ env.PIONBOT_PRIVATE_KEY != '' }}"
29+
30+
generate-authors:
31+
needs: [checksecret]
32+
if: needs.checksecret.outputs.is_PIONBOT_PRIVATE_KEY_set == 'true'
33+
runs-on: ubuntu-latest
34+
steps:
35+
- uses: actions/checkout@v3
36+
with:
37+
ref: ${{ github.head_ref }}
38+
fetch-depth: 0
39+
token: ${{ secrets.PIONBOT_PRIVATE_KEY }}
40+
41+
- name: Generate the authors file
42+
run: .github/generate-authors.sh
43+
44+
- name: Add the authors file to git
45+
run: git add AUTHORS.txt
46+
47+
- name: Get last commit message
48+
id: last-commit-message
49+
run: |
50+
COMMIT_MSG=$(git log -1 --pretty=%B)
51+
COMMIT_MSG="${COMMIT_MSG//'%'/'%25'}"
52+
COMMIT_MSG="${COMMIT_MSG//$'\n'/'%0A'}"
53+
COMMIT_MSG="${COMMIT_MSG//$'\r'/'%0D'}"
54+
echo "::set-output name=msg::$COMMIT_MSG"
55+
56+
- name: Get last commit author
57+
id: last-commit-author
58+
run: |
59+
echo "::set-output name=msg::$(git log -1 --pretty='%aN <%ae>')"
60+
61+
- name: Check if AUTHORS.txt file has changed
62+
id: git-status-output
63+
run: |
64+
echo "::set-output name=msg::$(git status -s | wc -l)"
65+
66+
- name: Commit and push
67+
if: ${{ steps.git-status-output.outputs.msg != '0' }}
68+
run: |
69+
git config user.email $(echo "${{ steps.last-commit-author.outputs.msg }}" | sed 's/\(.\+\) <\(\S\+\)>/\2/')
70+
git config user.name $(echo "${{ steps.last-commit-author.outputs.msg }}" | sed 's/\(.\+\) <\(\S\+\)>/\1/')
71+
git add AUTHORS.txt
72+
git commit --amend --no-edit
73+
git push --force https://github.com/${GITHUB_REPOSITORY} $(git symbolic-ref -q --short HEAD)

.github/workflows/lint.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
#
2+
# DO NOT EDIT THIS FILE
3+
#
4+
# It is automatically copied from https://github.com/pion/.goassets repository.
5+
# If this repository should have package specific CI config,
6+
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
7+
#
8+
# If you want to update the shared CI config, send a PR to
9+
# https://github.com/pion/.goassets instead of this repository.
10+
#
11+
112
name: Lint
213
on:
314
pull_request:
@@ -12,7 +23,7 @@ jobs:
1223
strategy:
1324
fail-fast: false
1425
steps:
15-
- uses: actions/checkout@v2
26+
- uses: actions/checkout@v3
1627
with:
1728
fetch-depth: 0
1829

@@ -22,9 +33,6 @@ jobs:
2233
- name: File names
2334
run: .github/lint-filename.sh
2435

25-
- name: Contributors
26-
run: .github/assert-contributors.sh
27-
2836
- name: Functions
2937
run: .github/lint-disallowed-functions-in-library.sh
3038

@@ -34,10 +42,10 @@ jobs:
3442
strategy:
3543
fail-fast: false
3644
steps:
37-
- uses: actions/checkout@v2
45+
- uses: actions/checkout@v3
3846

3947
- name: golangci-lint
40-
uses: golangci/golangci-lint-action@v2
48+
uses: golangci/golangci-lint-action@v3
4149
with:
4250
version: v1.31
4351
args: $GOLANGCI_LINT_EXRA_ARGS

.github/workflows/renovate-go-mod-fix.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: checkout
23-
uses: actions/checkout@v2
23+
uses: actions/checkout@v3
2424
with:
2525
fetch-depth: 2
2626
- name: fix

.github/workflows/test.yaml

Lines changed: 47 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
#
2+
# DO NOT EDIT THIS FILE
3+
#
4+
# It is automatically copied from https://github.com/pion/.goassets repository.
5+
# If this repository should have package specific CI config,
6+
# remove the repository name from .goassets/.github/workflows/assets-sync.yml.
7+
#
8+
# If you want to update the shared CI config, send a PR to
9+
# https://github.com/pion/.goassets instead of this repository.
10+
#
11+
112
name: Test
213
on:
314
push:
@@ -11,11 +22,11 @@ jobs:
1122
runs-on: ubuntu-latest
1223
strategy:
1324
matrix:
14-
go: ["1.15", "1.16"]
25+
go: ["1.16", "1.17"]
1526
fail-fast: false
1627
name: Go ${{ matrix.go }}
1728
steps:
18-
- uses: actions/checkout@v2
29+
- uses: actions/checkout@v3
1930

2031
- uses: actions/cache@v2
2132
with:
@@ -28,7 +39,7 @@ jobs:
2839
${{ runner.os }}-amd64-go-
2940
3041
- name: Setup Go
31-
uses: actions/setup-go@v2
42+
uses: actions/setup-go@v3
3243
with:
3344
go-version: ${{ matrix.go }}
3445

@@ -39,11 +50,19 @@ jobs:
3950
4051
- name: Run test
4152
run: |
53+
TEST_BENCH_OPTION="-bench=."
54+
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
55+
4256
go-acc -o cover.out ./... -- \
43-
-bench=. \
44-
-v -race
57+
${TEST_BENCH_OPTION} \
58+
-v -race
59+
60+
- name: Run TEST_HOOK
61+
run: |
62+
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
63+
if [ -n "${TEST_HOOK}" ]; then ${TEST_HOOK}; fi
4564
46-
- uses: codecov/codecov-action@v1
65+
- uses: codecov/codecov-action@v2
4766
with:
4867
file: ./cover.out
4968
name: codecov-umbrella
@@ -54,11 +73,11 @@ jobs:
5473
runs-on: ubuntu-latest
5574
strategy:
5675
matrix:
57-
go: ["1.15", "1.16"]
76+
go: ["1.16", "1.17"]
5877
fail-fast: false
5978
name: Go i386 ${{ matrix.go }}
6079
steps:
61-
- uses: actions/checkout@v2
80+
- uses: actions/checkout@v3
6281

6382
- uses: actions/cache@v2
6483
with:
@@ -73,30 +92,30 @@ jobs:
7392
run: |
7493
mkdir -p $HOME/go/pkg/mod $HOME/.cache
7594
docker run \
76-
-u $(id -u):$(id -g) \
77-
-e "GO111MODULE=on" \
78-
-e "CGO_ENABLED=0" \
79-
-v $GITHUB_WORKSPACE:/go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
80-
-v $HOME/go/pkg/mod:/go/pkg/mod \
81-
-v $HOME/.cache:/.cache \
82-
-w /go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
83-
i386/golang:${{matrix.go}}-alpine \
84-
/usr/local/go/bin/go test \
85-
${TEST_EXTRA_ARGS:-} \
86-
-v ./...
95+
-u $(id -u):$(id -g) \
96+
-e "GO111MODULE=on" \
97+
-e "CGO_ENABLED=0" \
98+
-v $GITHUB_WORKSPACE:/go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
99+
-v $HOME/go/pkg/mod:/go/pkg/mod \
100+
-v $HOME/.cache:/.cache \
101+
-w /go/src/github.com/pion/$(basename $GITHUB_WORKSPACE) \
102+
i386/golang:${{matrix.go}}-alpine \
103+
/usr/local/go/bin/go test \
104+
${TEST_EXTRA_ARGS:-} \
105+
-v ./...
87106
88107
test-wasm:
89108
runs-on: ubuntu-latest
90109
strategy:
91110
fail-fast: false
92111
name: WASM
93112
steps:
94-
- uses: actions/checkout@v2
113+
- uses: actions/checkout@v3
95114

96115
- name: Use Node.js
97-
uses: actions/setup-node@v2
116+
uses: actions/setup-node@v3
98117
with:
99-
node-version: '12.x'
118+
node-version: '16.x'
100119

101120
- uses: actions/cache@v2
102121
with:
@@ -110,7 +129,7 @@ jobs:
110129
- name: Download Go
111130
run: curl -sSfL https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz | tar -C ~ -xzf -
112131
env:
113-
GO_VERSION: 1.16
132+
GO_VERSION: 1.17
114133

115134
- name: Set Go Root
116135
run: echo "GOROOT=${HOME}/go" >> $GITHUB_ENV
@@ -126,12 +145,13 @@ jobs:
126145

127146
- name: Run Tests
128147
run: |
148+
if [ -f .github/.ci.conf ]; then . .github/.ci.conf; fi
129149
GOOS=js GOARCH=wasm $GOPATH/bin/go test \
130-
-coverprofile=cover.out -covermode=atomic \
131-
-exec="${GO_JS_WASM_EXEC}" \
132-
-v ./...
150+
-coverprofile=cover.out -covermode=atomic \
151+
-exec="${GO_JS_WASM_EXEC}" \
152+
-v ./...
133153
134-
- uses: codecov/codecov-action@v1
154+
- uses: codecov/codecov-action@v2
135155
with:
136156
file: ./cover.out
137157
name: codecov-umbrella

.github/workflows/tidy-check.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
runs-on: ubuntu-latest
2424
steps:
2525
- name: checkout
26-
uses: actions/checkout@v2
26+
uses: actions/checkout@v3
2727
- name: Setup Go
28-
uses: actions/setup-go@v2
28+
uses: actions/setup-go@v3
2929
- name: check
3030
run: |
3131
go mod download

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,4 @@ cover.out
2222
*.wasm
2323
examples/sfu-ws/cert.pem
2424
examples/sfu-ws/key.pem
25+
wasm_exec.js

AUTHORS.txt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Thank you to everyone that made Pion possible. If you are interested in contributing
2+
# we would love to have you https://github.com/pion/webrtc/wiki/Contributing
3+
#
4+
# This file is auto generated, using git to list all individuals contributors.
5+
# see `.github/generate-authors.sh` for the scripting
6+
adamroach <[email protected]>
7+
Agniva De Sarker <[email protected]>
8+
Antoine Baché <[email protected]>
9+
Atsushi Watanabe <[email protected]>
10+
11+
chenkaiC4 <[email protected]>
12+
Chris Hiszpanski <[email protected]>
13+
14+
Hugo Arregui <[email protected]>
15+
Jerko Steiner <[email protected]>
16+
Juliusz Chroboczek <[email protected]>
17+
Luke Curley <[email protected]>
18+
Luke Curley <[email protected]>
19+
Max Hawkins <[email protected]>
20+
mission-liao <[email protected]>
21+
Novel Corpse <[email protected]>
22+
OrlandoCo <[email protected]>
23+
Sean DuBois <[email protected]>
24+
Sean DuBois <[email protected]>
25+
Tobias Fridén <[email protected]>
26+
Woodrow Douglass <[email protected]>
27+
Yutaka Takeda <[email protected]>

0 commit comments

Comments
 (0)