-
-
Notifications
You must be signed in to change notification settings - Fork 754
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
271 changed files
with
33,640 additions
and
189 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
# GO:GENERATE | ||
go generate | ||
|
||
# FORMATTING | ||
exec 5>&1 | ||
output="$(go fmt ./... | tee /dev/fd/5)" | ||
[[ -z "$output" ]] | ||
|
||
# UNIT TESTS | ||
UNIT_TEST_REPORT=$(go test -timeout 30s -v -race ./...) | ||
|
||
returncode=$? | ||
if [ $returncode -ne 0 ]; then | ||
echo "unit tests failed" | ||
echo ${UNIT_TEST_REPORT} | ||
exit 1 | ||
fi | ||
|
||
go mod tidy | ||
|
||
git add . |
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,26 @@ | ||
--- | ||
name: Bug report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: bug | ||
assignees: andersfylling | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Error messages** | ||
If applicable, copy the errors messages into this thread to help explain your problem. | ||
|
||
**Desktop (please complete the following information):** | ||
- Golang version: [e.g. v1.13.1] | ||
- Using Go modules? [yes/no] | ||
- Disgord version? [e.g. v0.15] | ||
- Connected to the gateway before using REST methods? [yes/no] | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
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,20 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
title: '' | ||
labels: enhancement, help wanted | ||
assignees: andersfylling | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered - optional** | ||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context - optional** | ||
Add any other context or screenshots about the feature request here. |
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,29 @@ | ||
# Description | ||
|
||
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change. | ||
|
||
Use smart commits here to manipulate issues (eg. Fixes #issue) | ||
|
||
## Type of change | ||
|
||
Please delete options that are not relevant. | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
|
||
## Benchmarks | ||
If this PR requires benchmarks (say it is an very dependent component or takes a lot of resources/use, use pprof if you need to) then the benchmarks are provided before and after such that we can make logical decisions. | ||
Note that if you add a benchmark and find your solution to run slower, the code might still be valuable so your results are welcomed anyways! | ||
If no benchmarks are needed, feel free to delete til paragraph. | ||
|
||
# Checklist: | ||
|
||
- [ ] I ran `go generate` | ||
- [ ] I have performed a self-review of my own code (remember to run `go fmt ./...`) | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes | ||
- [ ] Any dependent changes have been merged and published in downstream modules | ||
- [ ] Added benchmarks if this is a performant required component (potential bottlenecks) |
29 changes: 29 additions & 0 deletions
29
disgord@custom/.github/PULL_REQUEST_TEMPLATE/breaking_change.md
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,29 @@ | ||
# Description | ||
|
||
Please include a summary of the PR. Do not create a PR into branch:develop unless there exist no branch for the next release. | ||
|
||
eg. If the current release is v0.10, then you should create a PR for branch:release/v0.11. If the next release branch is not out/created yet, create an issue or make a draft PR that goes into develop and change it to the release branch later on. Don't worry, I'll try my best to make this easy for everyone. | ||
|
||
## Type of change | ||
|
||
Please delete options that are not relevant. | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] New feature (non-breaking change which adds functionality) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
|
||
## Benchmarks | ||
If this PR requires benchmarks (say it is an very dependent component or takes a lot of resources/use, use pprof if you need to) then the benchmarks are provided before and after such that we can make logical decisions. | ||
Note that if you add a benchmark and find your solution to run slower, the code might still be valuable so your results are welcomed anyways! | ||
If no benchmarks are needed, feel free to delete til paragraph. | ||
|
||
# Checklist: | ||
|
||
- [ ] I ran `go generate` | ||
- [ ] I have performed a self-review of my own code (remember to run `go fmt ./...`) | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] New and existing unit tests pass locally with my changes | ||
- [ ] Any dependent changes have been merged and published in downstream modules | ||
- [ ] Added benchmarks if this is a performant required component (potential bottlenecks) |
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,25 @@ | ||
# Description | ||
|
||
Please include a summary of the change and which issue is fixed. | ||
|
||
Use smart commits here to manipulate issues (eg. Fixes #issue) | ||
|
||
## Type of change | ||
|
||
- [ ] Bug fix (non-breaking change which fixes an issue) | ||
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) | ||
|
||
## Benchmarks | ||
If this PR requires benchmarks (say it is an very dependent component or takes a lot of resources/use, use pprof if you need to) then the benchmarks are provided before and after such that we can make logical decisions. | ||
Note that if you add a benchmark and find your solution to run slower, the code might still be valuable so your results are welcomed anyways! | ||
If no benchmarks are needed, feel free to delete til paragraph. | ||
|
||
# Checklist: | ||
|
||
- [ ] I ran `go generate` | ||
- [ ] I have performed a self-review of my own code (remember to run `go fmt ./...`) | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation | ||
- [ ] I have added tests that prove my fix is effective or that my feature works | ||
- [ ] Any dependent changes have been merged and published in downstream modules | ||
- [ ] Added benchmarks if this is a performant required component (potential bottlenecks) |
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,53 @@ | ||
workflow "Code quality" { | ||
on = "pull_request" | ||
resolves = [ | ||
"go imports", | ||
//"go lint", | ||
//"go vet", | ||
"staticcheck", | ||
"errcheck", | ||
"go sec", | ||
"shadow", | ||
] | ||
} | ||
|
||
action "go imports" { | ||
uses = "grandcolline/golang-github-actions/imports@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
} | ||
|
||
action "go lint" { | ||
uses = "grandcolline/golang-github-actions/lint@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
} | ||
|
||
action "go vet" { | ||
uses = "grandcolline/golang-github-actions/vet@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
} | ||
|
||
action "shadow" { | ||
uses = "grandcolline/golang-github-actions/shadow@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
} | ||
|
||
action "staticcheck" { | ||
uses = "grandcolline/golang-github-actions/staticcheck@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
} | ||
|
||
action "errcheck" { | ||
uses = "grandcolline/golang-github-actions/errcheck@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
env = { | ||
IGNORE_DEFER = "true" | ||
} | ||
} | ||
|
||
action "go sec" { | ||
uses = "grandcolline/golang-github-actions/sec@v0.2.0" | ||
secrets = ["GITHUB_TOKEN"] | ||
env = { | ||
FLAGS = "-exclude=G104" | ||
} | ||
} |
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,43 @@ | ||
#!/bin/bash | ||
|
||
# github REST commands | ||
wget https://raw.githubusercontent.com/whiteinge/ok.sh/master/ok.sh -O gith | ||
chmod +x gith | ||
|
||
# get last closed milestone (yes this is a race cond) | ||
./gith list_milestones andersfylling/disgord state=closed sort=closed_at direction=desc > closed_milestones.txt | ||
VERSION="$(awk 'NR==1 {print $3}' "closed_milestones.txt")" | ||
if [[ ! ${VERSION:0:1} == "v" ]] ; then | ||
>&2 echo "ERROR: $(cat closed_milestones.txt)"; | ||
exit 1 | ||
fi | ||
|
||
# cleanup | ||
rm gith | ||
rm "closed_milestones.txt" | ||
|
||
# setup git env | ||
git config user.email "${GITHUB_EMAIL}" | ||
git config user.name "disgord (bot)" | ||
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git | ||
git checkout develop | ||
|
||
# update version const | ||
VERSION_FILE="constant/version.go" | ||
echo "package constant" > "${VERSION_FILE}" | ||
echo "const Version = \"${VERSION}\"" >> "${VERSION_FILE}" | ||
go fmt ./... | ||
go mod tidy | ||
|
||
# generate CHANGELOG.md | ||
#gem install github_changelog_generator | ||
#github_changelog_generator --release_windows-branch develop -u andersfylling -p disgord | ||
|
||
# commit, tag and push | ||
if [[ `git status --porcelain` ]]; then | ||
git add . | ||
#git commit -m "gen changelog & set version to ${VERSION}" | ||
git commit -m "set version to ${VERSION}" | ||
fi | ||
git tag "${VERSION}" -m "Disgord ${VERSION}" | ||
git push origin develop --tags |
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,28 @@ | ||
on: | ||
push: | ||
branches: | ||
- develop | ||
name: verify install script | ||
jobs: | ||
install-script: | ||
name: Make sure install script works | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
go: ['1.13'] | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
- name: create inputs | ||
run: | | ||
echo "botty" >> inputs.txt | ||
echo "" >> inputs.txt | ||
echo "" >> inputs.txt | ||
echo "n" >> inputs.txt | ||
echo "n" >> inputs.txt | ||
- name: run script | ||
run: cat inputs.txt | bash <(curl -s -L https://git.io/disgord-script) |
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,42 @@ | ||
name: PR Quality | ||
on: [pull_request] | ||
jobs: | ||
none: | ||
name: No build tags | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
go: ['1.13', '1.14'] | ||
steps: | ||
- name: Set up Go ${{ matrix.go }} | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
- name: Get dependencies | ||
run: go mod download | ||
- name: Format Test # ty Ikkerens | ||
run: diff <(gofmt -d ./...) <(echo -n) | ||
- name: test | ||
run: go test -v -race ./... | ||
buildtags: | ||
name: Build tags | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
buildtag: [disgord_diagnosews, json_std, disgord_removeDiscordMutex, disgord_parallelism, disgord_legacy, disgordperf] | ||
steps: | ||
- name: Set up Go 1.13 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.13 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v1 | ||
- name: Get dependencies | ||
run: go mod download | ||
- name: test | ||
run: go test -tags=${{ matrix.buildtag }} -v -race ./... |
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,46 @@ | ||
on: | ||
milestone: | ||
types: [closed] | ||
name: GoReleaser | ||
jobs: | ||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
go: ['1.13'] | ||
# needs: [ integration-tests ] | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
id: go | ||
- name: Check out code | ||
uses: actions/checkout@master | ||
# - name: install ruby and gem | ||
# run: | | ||
# sudo apt-get install ruby | ||
# wget https://rubygems.org/rubygems/rubygems-3.0.6.zip | ||
# unzip rubygems-3.0.6.zip -d . | ||
# sudo ruby rubygems-3.0.6/setup.rb | ||
- name: Update disgord version | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | ||
GITHUB_EMAIL: ${{ secrets.GITHUB_EMAIL }} | ||
run: | | ||
chmod +x .github/milestone-release.sh | ||
bash .github/milestone-release.sh | ||
- name: Check out code, again | ||
uses: actions/checkout@master | ||
- name: goreleaser | ||
uses: docker://goreleaser/goreleaser | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | ||
GORELEASER_GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }} | ||
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
with: | ||
args: release | ||
if: success() |
Oops, something went wrong.