Skip to content

Commit c42a9d9

Browse files
committed
Initial commit
0 parents  commit c42a9d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+16498
-0
lines changed

.devcontainer/Dockerfile

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Copyright (c) Pedersen authors.
4+
#
5+
# Use of this source code is governed by an MIT-style
6+
# license that can be found in the LICENSE file or at
7+
# https://opensource.org/licenses/MIT.
8+
9+
ARG GO_VARIANT=1.17-alpine
10+
11+
FROM golang:${GO_VARIANT}
12+
13+
ARG GO_OPENSSL_VERSION_OVERRIDE=1.1.1
14+
15+
ENV GO_OPENSSL_VERSION_OVERRIDE=${GO_OPENSSL_VERSION_OVERRIDE}
16+
17+
RUN apk update && \
18+
apk del --no-cache openssl && \
19+
apk add --no-cache make build-base pkgconfig coreutils perl linux-headers
20+
21+
COPY scripts/openssl.sh /tmp/openssl.sh
22+
23+
RUN /tmp/openssl.sh --dev ${GO_OPENSSL_VERSION_OVERRIDE}

.devcontainer/docs/Dockerfile

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# syntax=docker/dockerfile:1
2+
3+
# Copyright (c) Pedersen authors.
4+
#
5+
# Use of this source code is governed by an MIT-style
6+
# license that can be found in the LICENSE file or at
7+
# https://opensource.org/licenses/MIT.
8+
9+
ARG NODE_VERSION=20
10+
11+
FROM node:${NODE_VERSION}-alpine
12+
13+
EXPOSE 3000
14+
15+
WORKDIR /src
16+
17+
RUN apk add --no-cache git
18+
19+
ENV NODE_ENV=dev

.devcontainer/docs/devcontainer.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Pedersen Docs",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"context": "../..",
6+
"args": {
7+
"NODE_VERSION": "20"
8+
}
9+
},
10+
"postStartCommand": "cd docs && yarn install && yarn start",
11+
"customizations": {
12+
"vscode": {
13+
"extensions": ["ms-vscode.vscode-typescript-next", "leizongmin.node-module-intellisense"]
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Pedersen 1.0.2",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"context": "../..",
6+
"args": {
7+
"GO_VARIANT": "1.17-alpine",
8+
"GO_OPENSSL_VERSION_OVERRIDE": "1.0.2"
9+
}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"extensions": ["golang.go", "ms-vscode.cpptools-extension-pack"]
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Pedersen 1.1.0",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"context": "../..",
6+
"args": {
7+
"GO_VARIANT": "1.17-alpine",
8+
"GO_OPENSSL_VERSION_OVERRIDE": "1.1.0"
9+
}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"extensions": ["golang.go", "ms-vscode.cpptools-extension-pack"]
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Pedersen 1.1.1",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"context": "../..",
6+
"args": {
7+
"GO_VARIANT": "1.17-alpine",
8+
"GO_OPENSSL_VERSION_OVERRIDE": "1.1.1"
9+
}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"extensions": ["golang.go", "ms-vscode.cpptools-extension-pack"]
14+
}
15+
}
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "Pedersen 3.0.1",
3+
"build": {
4+
"dockerfile": "../Dockerfile",
5+
"context": "../..",
6+
"args": {
7+
"GO_VARIANT": "1.17-alpine",
8+
"GO_OPENSSL_VERSION_OVERRIDE": "3.0.1"
9+
}
10+
},
11+
"customizations": {
12+
"vscode": {
13+
"extensions": ["golang.go", "ms-vscode.cpptools-extension-pack"]
14+
}
15+
}
16+
}

.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bin/

.editorconfig

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
11+
# Matches multiple files with brace expansion notation
12+
# Set default charset
13+
[*.{go}]
14+
charset = utf-8
15+
16+
# 4 space indentation
17+
[*.go]
18+
indent_style = tab

.github/dependabot.yml

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: gomod
4+
directory: /
5+
schedule:
6+
interval: daily

.github/workflows/docs.yml

+127
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
---
2+
name: Docs
3+
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}
6+
cancel-in-progress: true
7+
8+
on:
9+
schedule:
10+
- cron: '0 8 */6 * *' # every 6 days to keep cache
11+
workflow_dispatch:
12+
inputs:
13+
release_tag:
14+
description: 'Release tag'
15+
required: true
16+
push:
17+
branches:
18+
- 'master'
19+
pull_request:
20+
branches:
21+
- 'master'
22+
23+
env:
24+
RELEASE_BRANCH: master
25+
26+
jobs:
27+
prepare:
28+
runs-on: ubuntu-22.04
29+
outputs:
30+
release_tag: ${{ steps.release_tag.outputs.release_tag }}
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v3
34+
with:
35+
fetch-depth: 0
36+
37+
- name: Get latest tag on release branch
38+
id: release_tag
39+
run: |
40+
set -ex
41+
if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ -n "${{ inputs.release_tag }}" ]; then
42+
echo "release_tag=${{ inputs.release_tag }}" >> $GITHUB_OUTPUT
43+
elif [ "${{ github.event_name }}" = "push" ] && [ "${{ github.ref }}" = "refs/heads/${{ env.RELEASE_BRANCH }}" ]; then
44+
echo "release_tag=$(git describe --match 'v[0-9]*' --abbrev=0 --tags ${RELEASE_BRANCH})" >> $GITHUB_OUTPUT || \
45+
echo "release_tag=" >> $GITHUB_OUTPUT
46+
else
47+
echo "release_tag=" >> $GITHUB_OUTPUT
48+
fi
49+
50+
- name: Show latest release tag
51+
run: |
52+
echo ${{ steps.release_tag.outputs.release_tag }}
53+
54+
build:
55+
runs-on: ubuntu-22.04
56+
needs: [prepare]
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@v3
60+
61+
- uses: docker/login-action@v2
62+
with:
63+
username: ${{ secrets.DOCKER_USERNAME }}
64+
password: ${{ secrets.DOCKER_TOKEN }}
65+
66+
- name: Set up Docker Buildx
67+
uses: docker/setup-buildx-action@v2
68+
69+
- name: Build docs
70+
uses: docker/bake-action@v3
71+
with:
72+
targets: docs
73+
set: |
74+
*.args.ORGANIZATION_NAME=${{ github.repository_owner }}
75+
*.args.REPO_NAME=${{ github.event.repository.name }}
76+
*.args.REPO_URL=${{ github.server_url }}/${{ github.repository }}
77+
*.args.DOCS_URL=https://${{ github.repository_owner }}.github.io
78+
*.args.DOCS_EDIT_URL=${{ github.server_url }}/${{ github.repository }}/tree/${{ env.RELEASE_BRANCH }}/docs/
79+
*.args.VERSION=${{ needs.prepare.outputs.release_tag }}
80+
*.cache-from=type=gha,scope=docs
81+
*.cache-to=type=gha,scope=docs,mode=max
82+
env:
83+
ALGOLIA_APP_ID: ${{ secrets.ALGOLIA_APP_ID }}
84+
ALGOLIA_SEARCH_API_KEY: ${{ secrets.ALGOLIA_SEARCH_API_KEY }}
85+
ALGOLIA_INDEX_NAME: ${{ secrets.ALGOLIA_INDEX_NAME }}
86+
87+
- name: Upload artifacts
88+
uses: actions/upload-artifact@v3
89+
with:
90+
name: docs
91+
path: ./bin/docs/*
92+
if-no-files-found: error
93+
94+
release:
95+
needs: [prepare, build]
96+
runs-on: ubuntu-22.04
97+
if: ${{ needs.prepare.outputs.release_tag != '' }}
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v3
101+
with:
102+
ref: gh-pages
103+
104+
- name: Download artifacts
105+
uses: actions/download-artifact@v3
106+
with:
107+
name: docs
108+
path: /tmp/pedersen-docs
109+
110+
- name: List docs files
111+
run: |
112+
echo "DOCS_FILES<<EOF" >> $GITHUB_ENV
113+
find /tmp/pedersen-docs -type f -printf "%P\n" >> $GITHUB_ENV
114+
echo "EOF" >> $GITHUB_ENV
115+
116+
- name: Move docs files
117+
run: |
118+
rsync -cavr --ignore-times --delete /tmp/pedersen-docs/ .
119+
120+
- name: Commit changes
121+
uses: swinton/commit@v2.x
122+
env:
123+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
124+
with:
125+
files: ${{ env.DOCS_FILES }}
126+
commit-message: Update docs
127+
ref: refs/heads/gh-pages

0 commit comments

Comments
 (0)