diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..f8ae82b20 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 \ No newline at end of file diff --git a/tools/build b/tools/build index dab6851b4..73469f948 100755 --- a/tools/build +++ b/tools/build @@ -1,3 +1,3 @@ #!/bin/bash -python $(dirname "$0")/helper.py build "$@" +python3 $(dirname "$0")/helper.py build "$@" diff --git a/tools/helper.py b/tools/helper.py index ac6f46be6..63e192a5a 100755 --- a/tools/helper.py +++ b/tools/helper.py @@ -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") diff --git a/tools/push b/tools/push index 638be1311..2234f23d9 100755 --- a/tools/push +++ b/tools/push @@ -16,4 +16,4 @@ if [[ $(uname -m) == "aarch64" ]]; then fi cd "$(dirname "$0")" || exit 1 -python helper.py push "$@" +python3 helper.py push "$@"