Skip to content

Commit b04f16b

Browse files
committed
code commit
1 parent 602f960 commit b04f16b

1,028 files changed

Lines changed: 334912 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: 👾 Bug Report
3+
about: Report a bug or issue with the project.
4+
title: ''
5+
labels: 'bug'
6+
assignees: ''
7+
8+
---
9+
10+
### Description
11+
A clear and concise description of what the bug is.
12+
13+
### Steps To Reproduce
14+
1. Log in...
15+
2. Ensure that...
16+
3. Allow a long period of inactivity to pass...
17+
4. Observe that...
18+
5. Attempt to log in...
19+
20+
### Current Behavior
21+
- After the period of inactivity...
22+
- When the user tries to log in using another method...
23+
- This causes a bug due to...
24+
25+
### Expected Behavior
26+
- After a long period of inactivity...
27+
- When a user logs in successfully...
28+
- This ensures that only...
29+
30+
### Environment
31+
- Platform: PC
32+
- Node: v18.18.0
33+
- Browser: Chrome 126.0.6478.56

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
blank_issues_enabled: false
2+
issue_template:
3+
- name: 👾 Bug Report
4+
description: Report a bug or issue with the project.
5+
labels: ["bug"]
6+
template: bug_report.md
7+
- name: 💡 Feature Request
8+
description: Create a new ticket for a new feature request.
9+
labels: ["enhancement"]
10+
template: feature_request.md
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
name: 💡 Feature Request
3+
about: Create a new ticket for a new feature request
4+
title: ''
5+
labels: 'enhancement'
6+
assignees: ''
7+
8+
---
9+
10+
### Expected Behavior
11+
Describe the expected behavior here.
12+
13+
### Specifications
14+
As a `user`, I would like to `action` so that `reason`.
15+
16+
**Features:**
17+
- describe feature details here.
18+
19+
**Development Tasks:**
20+
- [ ] Task 1
21+
- [ ] Task 2
22+
23+
### Dependencies
24+
List any dependencies that are required for this feature by providing links to the issues or repositories.
25+
26+
### References
27+
List any references that are related to this feature request.

.github/workflows/deploy-tag.yaml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Build and Deploy Release
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*.*.*"
7+
env:
8+
DOTNET_INSTALL_DIR: "./.dotnet"
9+
10+
jobs:
11+
publish:
12+
runs-on: aelfscan-runner
13+
strategy:
14+
matrix:
15+
servicename:
16+
[
17+
AElfScanServer.Worker,
18+
AElfScanServer.HttpApi.Host,
19+
AElfScanServer.Silo,
20+
AElfScanServer.AuthServer,
21+
AElfScanServer.DbMigrator
22+
]
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-dotnet@v4
26+
with:
27+
dotnet-version: "8.0"
28+
- run: dotnet publish src/${{ matrix.servicename }}/${{ matrix.servicename }}.csproj -o out/${{ matrix.servicename }}
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v4
31+
with:
32+
name: ${{ matrix.servicename }}
33+
path: out/${{ matrix.servicename }}
34+
retention-days: 1
35+
build-and-push-image:
36+
needs: publish
37+
runs-on: aelfscan-runner
38+
strategy:
39+
matrix:
40+
servicename:
41+
[
42+
AElfScanServer.Worker,
43+
AElfScanServer.HttpApi.Host,
44+
AElfScanServer.Silo,
45+
AElfScanServer.AuthServer,
46+
AElfScanServer.DbMigrator
47+
]
48+
permissions:
49+
contents: read
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
- name: Download a single artifact
54+
uses: actions/download-artifact@v4
55+
with:
56+
name: ${{ matrix.servicename }}
57+
path: out/${{ matrix.servicename }}
58+
- name: Create image tag
59+
id: meta
60+
uses: docker/metadata-action@v5
61+
with:
62+
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ matrix.servicename }}
63+
tags: |
64+
type=ref,event=tag
65+
- name: Set up Docker Buildx
66+
uses: docker/setup-buildx-action@v3
67+
- name: Build and push
68+
uses: docker/build-push-action@v5
69+
with:
70+
context: .
71+
push: true
72+
build-args: |
73+
servicename=${{ matrix.servicename }}
74+
platforms: linux/amd64
75+
tags: ${{ steps.meta.outputs.tags }}
76+
labels: ${{ steps.meta.outputs.labels }}
77+
78+
dispatch:
79+
runs-on: aelfscan-runner
80+
needs: build-and-push-image
81+
steps:
82+
- name: Deploy
83+
uses: actions/github-script@v6
84+
with:
85+
github-token: ${{ secrets.TOK }}
86+
script: |
87+
await github.rest.actions.createWorkflowDispatch({
88+
owner: 'AelfScanProject',
89+
repo: 'devops',
90+
workflow_id: 'aelf-explorer-server-deploy.yaml',
91+
ref: 'main',
92+
inputs: {
93+
env: 'production',
94+
appName: 'aelf-explorer-backend',
95+
commit_sha: '${{ github.ref_name }}',
96+
}
97+
})
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build and Deploy Testnet Pre
2+
3+
on:
4+
push:
5+
branches:
6+
- "pre-release/*"
7+
env:
8+
DOTNET_INSTALL_DIR: "./.dotnet"
9+
10+
jobs:
11+
publish:
12+
runs-on: aelfscan-runner
13+
strategy:
14+
matrix:
15+
servicename:
16+
[
17+
AElfScanServer.HttpApi.Host,
18+
]
19+
steps:
20+
- uses: actions/checkout@v4
21+
- uses: actions/setup-dotnet@v4
22+
with:
23+
dotnet-version: "8.0"
24+
- run: dotnet publish src/${{ matrix.servicename }}/${{ matrix.servicename }}.csproj -o out/${{ matrix.servicename }}
25+
- name: Upload build artifacts
26+
uses: actions/upload-artifact@v4
27+
with:
28+
name: ${{ matrix.servicename }}
29+
path: out/${{ matrix.servicename }}
30+
retention-days: 1
31+
build-and-push-image:
32+
needs: publish
33+
runs-on: aelfscan-runner
34+
strategy:
35+
matrix:
36+
servicename:
37+
[
38+
AElfScanServer.HttpApi.Host,
39+
]
40+
permissions:
41+
contents: read
42+
outputs:
43+
short_sha: ${{ steps.vars.outputs.short_sha }}
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
- name: Set short git commit SHA
48+
id: vars
49+
run: |
50+
calculatedSha=$(git rev-parse --short ${{ github.sha }})
51+
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
52+
- name: Download a single artifact
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: ${{ matrix.servicename }}
56+
path: out/${{ matrix.servicename }}
57+
- name: Create image tag
58+
id: meta
59+
uses: docker/metadata-action@v5
60+
with:
61+
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ matrix.servicename }}
62+
tags: |
63+
type=sha
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
- name: Build and push
67+
uses: docker/build-push-action@v5
68+
with:
69+
context: .
70+
push: true
71+
build-args: |
72+
servicename=${{ matrix.servicename }}
73+
platforms: linux/amd64
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
77+
dispatch:
78+
runs-on: aelfscan-runner
79+
needs: build-and-push-image
80+
steps:
81+
- name: Deploy
82+
uses: actions/github-script@v6
83+
with:
84+
github-token: ${{ secrets.TOK }}
85+
script: |
86+
await github.rest.actions.createWorkflowDispatch({
87+
owner: 'AelfScanProject',
88+
repo: 'devops',
89+
workflow_id: 'aelf-explorer-server-deploy.yaml',
90+
ref: 'main',
91+
inputs: {
92+
env: 'testnet',
93+
appName: 'aelf-explorer-httpapi-host-pre',
94+
commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}',
95+
}
96+
})
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
name: Build and Deploy Testnet
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
servicename:
7+
description: 'Select service to build and deploy'
8+
required: true
9+
default: 'AElfScanServer.Worker'
10+
type: choice
11+
options:
12+
- AElfScanServer.Worker
13+
- AElfScanServer.HttpApi.Host
14+
- AElfScanServer.Silo
15+
- AElfScanServer.AuthServer
16+
- AElfScanServer.DbMigrator
17+
18+
env:
19+
DOTNET_INSTALL_DIR: "./.dotnet"
20+
21+
jobs:
22+
publish:
23+
runs-on: aelfscan-runner
24+
steps:
25+
- uses: actions/checkout@v4
26+
- uses: actions/setup-dotnet@v4
27+
with:
28+
dotnet-version: "8.0"
29+
- run: dotnet publish src/${{ github.event.inputs.servicename}}/${{ github.event.inputs.servicename }}.csproj -o out/${{ github.event.inputs.servicename }}
30+
- name: Upload build artifacts
31+
uses: actions/upload-artifact@v4
32+
with:
33+
name: ${{ github.event.inputs.servicename }}
34+
path: out/${{ github.event.inputs.servicename }}
35+
retention-days: 1
36+
37+
build-and-push-image:
38+
needs: publish
39+
runs-on: aelfscan-runner
40+
permissions:
41+
contents: read
42+
outputs:
43+
short_sha: ${{ steps.vars.outputs.short_sha }}
44+
steps:
45+
- name: Checkout
46+
uses: actions/checkout@v4
47+
- name: Set short git commit SHA
48+
id: vars
49+
run: |
50+
calculatedSha=$(git rev-parse --short ${{ github.sha }})
51+
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
52+
- name: Download a single artifact
53+
uses: actions/download-artifact@v4
54+
with:
55+
name: ${{ github.event.inputs.servicename }}
56+
path: out/${{ github.event.inputs.servicename }}
57+
- name: Create image tag
58+
id: meta
59+
uses: docker/metadata-action@v5
60+
with:
61+
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ github.event.inputs.servicename }}
62+
tags: |
63+
type=sha
64+
- name: Set up Docker Buildx
65+
uses: docker/setup-buildx-action@v3
66+
- name: Build and push
67+
uses: docker/build-push-action@v5
68+
with:
69+
context: .
70+
push: true
71+
build-args: |
72+
servicename=${{ github.event.inputs.servicename }}
73+
platforms: linux/amd64
74+
tags: ${{ steps.meta.outputs.tags }}
75+
labels: ${{ steps.meta.outputs.labels }}
76+
77+
dispatch:
78+
runs-on: aelfscan-runner
79+
needs: build-and-push-image
80+
steps:
81+
- name: Map servicename to appName
82+
id: map-appname
83+
run: |
84+
case "${{ github.event.inputs.servicename }}" in
85+
"AElfScanServer.HttpApi.Host")
86+
appName="aelf-explorer-httpapi-host"
87+
;;
88+
"AElfScanServer.Worker")
89+
appName="aelf-explorer-worker"
90+
;;
91+
"AElfScanServer.Silo")
92+
appName="aelf-explorer-silo"
93+
;;
94+
"AElfScanServer.AuthServer")
95+
appName="aelf-explorer-authserver"
96+
;;
97+
"AElfScanServer.DbMigrator")
98+
appName="aelf-explorer-dbmigrator"
99+
;;
100+
*)
101+
echo "Unknown service name: ${{ github.event.inputs.servicename }}"
102+
exit 1
103+
;;
104+
esac
105+
echo "appName=$appName" >> "$GITHUB_ENV"
106+
107+
- name: Deploy
108+
uses: actions/github-script@v6
109+
with:
110+
github-token: ${{ secrets.TOK }}
111+
script: |
112+
await github.rest.actions.createWorkflowDispatch({
113+
owner: 'AelfScanProject',
114+
repo: 'devops',
115+
workflow_id: 'aelf-explorer-server-deploy.yaml',
116+
ref: 'main',
117+
inputs: {
118+
env: 'testnet',
119+
appName: process.env.appName,
120+
commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}',
121+
}
122+
})

0 commit comments

Comments
 (0)