Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Security Review

permissions:
pull-requests: write
contents: read

on:
pull_request:

jobs:
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha || github.sha }}
fetch-depth: 2

- uses: Portkey-Wallet/claude-code-security-review@main
with:
comment-pr: true
claude-api-key: ${{ secrets.CLAUDE_API_KEY }}
run-every-commit: true
96 changes: 96 additions & 0 deletions .github/workflows/testnet-package.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
name: build and package
on:
push:
branches:
- 'release/*'
env:
DOTNET_INSTALL_DIR: "./.dotnet"
jobs:
publish:
runs-on: tmrwdao-runner
strategy:
matrix:
servicename:
[
SecurityServer.HttpApi.Host
]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '7.0' # which dotnet version is required?
- run: dotnet publish src/${{ matrix.servicename }}/${{ matrix.servicename }}.csproj -c Release -o out/${{ matrix.servicename }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.servicename }}
path: out/${{ matrix.servicename }}
retention-days: 1
build-and-push-image:
needs: publish
runs-on: tmrwdao-runner
strategy:
matrix:
servicename:
[
SecurityServer.HttpApi.Host
]
permissions:
contents: read
outputs:
short_sha: ${{ steps.vars.outputs.short_sha }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "short_sha=$calculatedSha" >> "$GITHUB_OUTPUT"
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: ${{ matrix.servicename }}
path: out/${{ matrix.servicename }}
- name: Create image tag
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.REPOSITORY_REGION }}-docker.pkg.dev/${{ secrets.PROJECT_ID }}/${{ secrets.REPOSITORY }}/${{ matrix.servicename }}
tags: |
type=sha
- # Setting up Docker Buildx with docker-container driver is required
# at the moment to be able to use a subdirectory with Git context
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
push: true
build-args: |
servicename=${{ matrix.servicename }}
platforms: linux/amd64
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
dispatch:
runs-on: tmrwdao-runner
needs: build-and-push-image
steps:
- name: Deploy
uses: actions/github-script@v6
with:
github-token: ${{ secrets.TOK }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'TomorrowDAOProject',
repo: 'devops',
workflow_id: 'deployment_testnet.yaml',
ref: 'main',
inputs: {
appName: 'securityserver-httpapi-host',
commit_sha: 'sha-${{ needs.build-and-push-image.outputs.short_sha }}',
}
})
Loading
Loading