Skip to content

Commit

Permalink
regex changed and new github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
lAmeR1 committed Jul 16, 2024
1 parent 9e2e236 commit bfbff59
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 3 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/docker-branches.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Image
on:
push:
branches-ignore:
- main

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest]
arch: [amd64, arm64]

runs-on: ${{ matrix.os }}

steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: lamer1
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Set up QEMU (for ARM64 emulation)
if: matrix.arch == 'arm64'
run: |
sudo apt-get install -y qemu-user-static
- name: Set up Docker Buildx (for multi-platform builds)
uses: docker/setup-buildx-action@v1

- name: Build and push Docker image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t kaspanet/kaspa-rest-server:${SHORT_SHA} \
-t kaspanet/kaspa-rest-server:${GITHUB_REF_NAME} \
--push .
docker buildx imagetools inspect kaspanet/kaspa-rest-server:${SHORT_SHA}
44 changes: 44 additions & 0 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Docker Image
on:
release:
types: [ published ]

jobs:
build:
strategy:
matrix:
os: [ ubuntu-latest ]
arch: [ amd64, arm64 ]

runs-on: ${{ matrix.os }}

steps:
- name: Add SHORT_SHA env property with commit short sha
run: echo "SHORT_SHA=`echo ${GITHUB_SHA} | cut -c1-7`" >> $GITHUB_ENV
- name: Checkout code
uses: actions/checkout@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: lamer1
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Set up QEMU (for ARM64 emulation)
if: matrix.arch == 'arm64'
run: |
sudo apt-get install -y qemu-user-static
- name: Set up Docker Buildx (for multi-platform builds)
uses: docker/setup-buildx-action@v1

- name: Build and push Docker image
run: |
docker buildx build \
--platform linux/amd64,linux/arm64 \
-t kaspanet/kaspa-rest-server:${{github.ref_name}} \
-t kaspanet/kaspa-rest-server:latest \
--build-arg version=${{github.ref_name}} \
--push .
docker buildx imagetools inspect kaspanet/kaspa-rest-server:latest
4 changes: 1 addition & 3 deletions endpoints/get_address_transactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from sqlalchemy.future import select
from starlette.responses import Response

from constants import ADDRESS_EXAMPLE
from constants import ADDRESS_EXAMPLE, REGEX_KASPA_ADDRESS
from dbsession import async_session
from endpoints import sql_db_only
from endpoints.get_transactions import search_for_transactions, TxSearch, TxModel
Expand All @@ -22,8 +22,6 @@
" Light fetches only the address and amount. Full fetches the whole TransactionOutput and " \
"adds it into each TxInput."

REGEX_KASPA_ADDRESS = "^kaspa(test)?\:[a-z0-9]{61,63}$"


class TransactionsReceivedAndSpent(BaseModel):
tx_received: str
Expand Down

0 comments on commit bfbff59

Please sign in to comment.