-
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.
- Loading branch information
Showing
14 changed files
with
659 additions
and
0 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,40 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
# run only against tags | ||
tags: | ||
- '*' | ||
|
||
permissions: | ||
contents: write | ||
# packages: write | ||
# issues: write | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Fetch all tags | ||
run: git fetch --force --tags | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
# either 'goreleaser' (default) or 'goreleaser-pro' | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,12 @@ | ||
|
||
linters: | ||
disable-all: true | ||
enable: | ||
- staticcheck | ||
- gofmt | ||
- govet | ||
- gosimple | ||
- structcheck | ||
- varcheck | ||
- unused | ||
- typecheck |
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,34 @@ | ||
FROM golang:1.16.9 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
clang \ | ||
libsqlite3-dev \ | ||
patch \ | ||
tar \ | ||
xz-utils \ | ||
python \ | ||
python3-pip \ | ||
python-setuptools \ | ||
--no-install-recommends \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN useradd -ms /bin/bash notary \ | ||
&& pip install codecov | ||
|
||
ENV GO111MODULE=on | ||
|
||
RUN go get golang.org/x/lint/golint \ | ||
github.com/client9/misspell/cmd/misspell \ | ||
github.com/gordonklaus/ineffassign \ | ||
github.com/securego/gosec/cmd/gosec/... \ | ||
github.com/fzipp/gocyclo/cmd/gocyclo | ||
|
||
|
||
ENV GOFLAGS=-mod=vendor \ | ||
NOTARYDIR=/go/src/github.com/theupdateframework/notary | ||
|
||
COPY . ${NOTARYDIR} | ||
RUN chmod -R a+rw /go && chmod 0600 ${NOTARYDIR}/fixtures/database/* | ||
|
||
WORKDIR ${NOTARYDIR} |
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,39 @@ | ||
project_name: dappspec | ||
builds: | ||
- ldflags: | ||
- "-s -w" | ||
- "-extldflags=-zrelro" | ||
- "-extldflags=-znow" | ||
env: | ||
- "CGO_ENABLED=0" | ||
- "GO111MODULE=on" | ||
flags: | ||
- -mod=readonly | ||
- -trimpath | ||
goos: | ||
- linux | ||
- darwin | ||
- windows | ||
goarch: | ||
- amd64 | ||
main: ./dappspec | ||
source: | ||
enabled: true | ||
changelog: | ||
use: github | ||
groups: | ||
- title: "Breaking changes" | ||
regexp: "^.*BREAKING CHANGE[(\\w)]*:+.*$" | ||
order: 0 | ||
- title: Features | ||
regexp: "^.*feat[(\\w)]*:+.*$" | ||
order: 1 | ||
- title: "Bug fixes" | ||
regexp: "^.*fix[(\\w)]*:+.*$" | ||
order: 2 | ||
- title: Others | ||
order: 999 | ||
release: | ||
# If set to auto, will mark the release as not ready for production | ||
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1 | ||
prerelease: auto |
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,6 @@ | ||
|
||
package proto | ||
|
||
// this file exists solely to allow us to use `go generate` to build our | ||
// compiled GRPC interface for Go. | ||
//go:generate protoc -I ./ ./signer.proto --go_out=plugins=grpc:. |
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,5 @@ | ||
module github.com/sambacha/dappspec | ||
|
||
go 1.18 | ||
|
||
require github.com/russross/blackfriday v1.6.0 |
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,2 @@ | ||
github.com/russross/blackfriday v1.6.0 h1:KqfZb0pUVN2lYqZUYRddxF4OR8ZMURnJIG5Y3VRLtww= | ||
github.com/russross/blackfriday v1.6.0/go.mod h1:ti0ldHuxg49ri4ksnFxlkCfN+hvslNlmVHqNRXXJNAY= |
Submodule gocco
added at
626123
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,14 @@ | ||
[ | ||
{ | ||
"tag_name": "nightly-bfc6790f134ad56746f12e9e1c7f183add780889" | ||
}, | ||
{ | ||
"tag_name": "nightly" | ||
}, | ||
{ | ||
"tag_name": "nightly-6422ea7fefef8cbc00fcb00cd2576f0a99c10e08" | ||
}, | ||
{ | ||
"tag_name": "nightly-123ad0a427dc938a0a911eae3332de6576370a51" | ||
} | ||
] |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eu -o pipefail | ||
|
||
go mod tidy | ||
if [ -d vendor ]; then | ||
rm -rf vendor/ | ||
go mod vendor | ||
fi | ||
|
||
DIFF_PATH="vendor/ go.mod go.sum" | ||
|
||
# shellcheck disable=SC2046 | ||
DIFF=$(git status --porcelain -- $DIFF_PATH) | ||
|
||
if [ "$DIFF" ]; then | ||
echo | ||
echo "These files were modified:" | ||
echo | ||
echo "$DIFF" | ||
echo | ||
exit 1 | ||
else | ||
echo "$DIFF_PATH is correct" | ||
fi |
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,7 @@ | ||
#!/usr/bin/env /bash | ||
FILES=$(git diff --cached --name-only --diff-filter=ACMR) | ||
|
||
gofumpt -l -w . | ||
golangci-lint run --new --fix | ||
|
||
git add $FILES |
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,35 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euo pipefail | ||
|
||
GITHUB_TOKEN='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' | ||
|
||
get_last_page() { | ||
local url="$1" | ||
curl -sSf -I -H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
"$url" | | ||
grep -E '^link: ' | | ||
sed -e 's/^link:.*page=//g' -e 's/>.*$//g' || echo "1" | ||
} | ||
|
||
generate() { | ||
local url="$1" | ||
local file="$2" | ||
last_page="$(get_last_page "$url")" | ||
tmp="$(mktemp -d)" | ||
|
||
for i in $(seq 1 "$last_page"); do | ||
echo "page: $i" | ||
curl -H "Authorization: Bearer $GITHUB_TOKEN" -sSf "$url?page=$i" | jq 'map({tag_name: .tag_name})' >"$tmp/$i.json" | ||
done | ||
|
||
if test "$last_page" -eq "1"; then | ||
cp -f "$tmp"/1.json "$file" | ||
else | ||
jq --compact-output -s 'add' "$tmp"/*.json >"$file" | ||
fi | ||
du -hs "$file" | ||
} | ||
|
||
# www/docs/static/releases.json | ||
generate "https://api.github.com/repos/foundry-rs/foundry/releases" "releases.json" |
Oops, something went wrong.