Skip to content

Commit

Permalink
devop: merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
kvhnuke committed Dec 13, 2024
2 parents 1db5c44 + 97cae1f commit 416e344
Show file tree
Hide file tree
Showing 913 changed files with 59,727 additions and 32,389 deletions.
104 changes: 104 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
language: en-US
tone_instructions: ""
early_access: false
enable_free_tier: true
reviews:
profile: chill
request_changes_workflow: true
high_level_summary: true
high_level_summary_placeholder: "@coderabbitai summary"
auto_title_placeholder: "@coderabbitai"
review_status: true
commit_status: true
poem: false
collapse_walkthrough: false
sequence_diagrams: true
changed_files_summary: true
labeling_instructions: []
path_filters: []
path_instructions: []
abort_on_close: true
auto_review:
enabled: true
auto_incremental_review: true
ignore_title_keywords:
- "!CR"
drafts: false
base_branches:
- main
- develop
- devop/vite-migrate
tools:
shellcheck:
enabled: true
ruff:
enabled: true
markdownlint:
enabled: true
github-checks:
enabled: true
timeout_ms: 90000
languagetool:
enabled: true
enabled_only: false
level: default
enabled_rules: []
disabled_rules: []
enabled_categories: []
disabled_categories: []
biome:
enabled: true
hadolint:
enabled: true
swiftlint:
enabled: true
phpstan:
enabled: true
level: default
golangci-lint:
enabled: true
yamllint:
enabled: true
gitleaks:
enabled: true
checkov:
enabled: true
detekt:
enabled: true
eslint:
enabled: true
rubocop:
enabled: true
buf:
enabled: true
regal:
enabled: true
actionlint:
enabled: true
pmd:
enabled: true
cppcheck:
enabled: true
semgrep:
enabled: true
circleci:
enabled: true
ast-grep:
packages: []
rule_dirs: []
util_dirs: []
essential_rules: true
chat:
auto_reply: true
knowledge_base:
opt_out: false
learnings:
scope: auto
issues:
scope: auto
jira:
project_keys: []
linear:
team_keys: []
pull_requests:
scope: auto
54 changes: 47 additions & 7 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Build all and Check VirusTotal

on: [push]
on: [pull_request]

jobs:
buildAll:
Expand All @@ -9,6 +9,14 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Comment Building
uses: thollander/actions-comment-pull-request@v3
with:
message: |
:monkey: Monkeys are building your code...
comment-tag: pr_build_message
mode: upsert

- name: setup env
id: node-version
run: |
Expand All @@ -20,7 +28,7 @@ jobs:
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache yarn modules
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand All @@ -36,21 +44,53 @@ jobs:
VIRUS_TOTAL_API_KEY: ${{secrets.VIRUS_TOTAL_API_KEY}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir release-chrome
mkdir release-firefox
docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" enkrypt-build-container /bin/bash -c "yarn build:all"
docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" enkrypt-build-container /bin/bash -c "cd packages/extension && yarn build:chrome && yarn zip"
cp -r packages/extension/dist/* release-chrome
rm release-chrome/release.zip
FILE_SHA256=`sha256sum ./packages/extension/dist/release.zip | awk '{print $1}'`
curl --request GET --url https://www.virustotal.com/api/v3/files/upload_url --header "x-apikey: $VIRUS_TOTAL_API_KEY"
UPLOAD_URL=`curl --request GET --url https://www.virustotal.com/api/v3/files/upload_url --header "x-apikey: $VIRUS_TOTAL_API_KEY" | jq --raw-output '.data'`
curl --request POST --url "$UPLOAD_URL" --header "x-apikey: $VIRUS_TOTAL_API_KEY" --header 'Accept: application/json' --header 'Content-Type: multipart/form-data' -F "file=@./packages/extension/dist/release.zip"
VIRUS_TOTAL_URL_CHROME=https://www.virustotal.com/gui/file/$FILE_SHA256
docker run --rm -v `pwd`:/home:rw --user "$(id -u):$(id -g)" enkrypt-build-container /bin/bash -c "cd packages/extension && yarn build:firefox && yarn zip"
cp -r packages/extension/dist/* release-firefox
rm release-firefox/release.zip
FILE_SHA256=`sha256sum ./packages/extension/dist/release.zip | awk '{print $1}'`
curl --request GET --url https://www.virustotal.com/api/v3/files/upload_url --header "x-apikey: $VIRUS_TOTAL_API_KEY"
UPLOAD_URL=`curl --request GET --url https://www.virustotal.com/api/v3/files/upload_url --header "x-apikey: $VIRUS_TOTAL_API_KEY" | jq --raw-output '.data'`
curl --request POST --url "$UPLOAD_URL" --header "x-apikey: $VIRUS_TOTAL_API_KEY" --header 'Accept: application/json' --header 'Content-Type: multipart/form-data' -F "file=@./packages/extension/dist/release.zip"
VIRUS_TOTAL_URL_FIREFOX=https://www.virustotal.com/gui/file/$FILE_SHA256
curl -H "Authorization: token ${GITHUB_TOKEN}" -X POST \
-d "{\"body\": \"Virus total analysis <br/>chrome: <br/>$VIRUS_TOTAL_URL_CHROME<br/> \
firefox: <br/> \
$VIRUS_TOTAL_URL_FIREFOX\"}" \
"https://api.github.com/repos/${GITHUB_REPOSITORY}/commits/${GITHUB_SHA}/comments"
echo "VIRUS_TOTAL_URL_CHROME=$VIRUS_TOTAL_URL_CHROME" >> $GITHUB_ENV
echo "VIRUS_TOTAL_URL_FIREFOX=$VIRUS_TOTAL_URL_FIREFOX" >> $GITHUB_ENV
echo "SHORT_SHA=`echo $(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha) | cut -c1-8`" >> $GITHUB_ENV
- uses: actions/upload-artifact@v4
id: artifact-upload-chrome
with:
name: enkrypt-chrome-${{ env.SHORT_SHA }}
path: ./release-chrome
retention-days: 3

- uses: actions/upload-artifact@v4
id: artifact-upload-firefox
with:
name: enkrypt-firefox-${{ env.SHORT_SHA }}
path: ./release-firefox
retention-days: 3

- name: Comment PR
uses: thollander/actions-comment-pull-request@v3
with:
message: |
:briefcase: Build Files
chrome: [enkrypt-chrome-${{ env.SHORT_SHA }}.zip](${{ steps.artifact-upload-chrome.outputs.artifact-url }})
firefox: [enkrypt-firefox-${{ env.SHORT_SHA }}.zip](${{ steps.artifact-upload-firefox.outputs.artifact-url }})
:syringe: Virus total analysis
chrome: [${{ env.SHORT_SHA }}](${{ env.VIRUS_TOTAL_URL_CHROME }})
firefox: [${{ env.SHORT_SHA }}](${{ env.VIRUS_TOTAL_URL_FIREFOX }})
comment-tag: pr_build_message
mode: upsert
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
run: echo "dir=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT

- name: Cache yarn modules
uses: actions/cache@v3
uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test-all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
- uses: actions/setup-node@v4
with:
node-version: "20"
node-version: "22.10.0"
cache: "yarn"
- run: yarn install
- run: yarn build:all
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,6 @@ dist
.DS_Store

.nova/

# IDE
.history
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v22.11.0
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"recommendations": [
"Vue.volar",
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
"johnsoncodehk.volar"
"esbenp.prettier-vscode"
]
}
6 changes: 5 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@
"changeProcessCWD": true
}
],
"cSpell.words": ["enkrypt", "enkryptcom", "polkadot", "webextension"]
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
Loading

0 comments on commit 416e344

Please sign in to comment.