Skip to content

Commit

Permalink
add github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
reliveyy committed Oct 28, 2020
1 parent 27519ab commit 5d5034f
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 4 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: ci

on:
push:
branches: pi

jobs:
build-amd64:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Show Python version
run: python -c "import sys; print(sys.version)"
- name: Build and push
run: tools/push -p linux/amd64 utils xud
build-arm64:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: 'x64'
- name: Show Python version
run: python -c "import sys; print(sys.version)"
- name: Build and push
run: tools/push -p linux/arm64 utils xud
2 changes: 1 addition & 1 deletion tools/build
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash

python $(dirname "$0")/helper.py build "$@"
python3 $(dirname "$0")/helper.py build "$@"
4 changes: 2 additions & 2 deletions tools/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ def main():
build_parser = subparsers.add_parser("build", prog="build")
build_parser.add_argument("--dry-run", action="store_true")
build_parser.add_argument("--no-cache", action="store_true")
build_parser.add_argument("--platform", action="append")
build_parser.add_argument("--platform", "-p", action="append")
build_parser.add_argument("images", type=str, nargs="*")

push_parser = subparsers.add_parser("push")
push_parser.add_argument("--dirty-push", action="store_true")
push_parser.add_argument("--dry-run", action="store_true")
push_parser.add_argument("--no-cache", action="store_true")
push_parser.add_argument("--platform", action="append")
push_parser.add_argument("--platform", "-p", action="append")
push_parser.add_argument("images", type=str, nargs="*")

subparsers.add_parser("test")
Expand Down
2 changes: 1 addition & 1 deletion tools/push
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ if [[ $(uname -m) == "aarch64" ]]; then
fi

cd "$(dirname "$0")" || exit 1
python helper.py push "$@"
python3 helper.py push "$@"

0 comments on commit 5d5034f

Please sign in to comment.