Skip to content

Commit 5d5034f

Browse files
committed
add github actions
1 parent 27519ab commit 5d5034f

File tree

4 files changed

+57
-4
lines changed

4 files changed

+57
-4
lines changed

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: ci
2+
3+
on:
4+
push:
5+
branches: pi
6+
7+
jobs:
8+
build-amd64:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Set up QEMU
12+
uses: docker/setup-qemu-action@v1
13+
- name: Set up Docker Buildx
14+
uses: docker/setup-buildx-action@v1
15+
- name: Login to DockerHub
16+
uses: docker/login-action@v1
17+
with:
18+
username: ${{ secrets.DOCKERHUB_USERNAME }}
19+
password: ${{ secrets.DOCKERHUB_TOKEN }}
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
- name: Set up Python 3.9
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.9'
26+
architecture: 'x64'
27+
- name: Show Python version
28+
run: python -c "import sys; print(sys.version)"
29+
- name: Build and push
30+
run: tools/push -p linux/amd64 utils xud
31+
build-arm64:
32+
runs-on: ubuntu-latest
33+
steps:
34+
- name: Set up QEMU
35+
uses: docker/setup-qemu-action@v1
36+
- name: Set up Docker Buildx
37+
uses: docker/setup-buildx-action@v1
38+
- name: Login to DockerHub
39+
uses: docker/login-action@v1
40+
with:
41+
username: ${{ secrets.DOCKERHUB_USERNAME }}
42+
password: ${{ secrets.DOCKERHUB_TOKEN }}
43+
- name: Checkout
44+
uses: actions/checkout@v2
45+
- name: Set up Python 3.9
46+
uses: actions/setup-python@v2
47+
with:
48+
python-version: '3.9'
49+
architecture: 'x64'
50+
- name: Show Python version
51+
run: python -c "import sys; print(sys.version)"
52+
- name: Build and push
53+
run: tools/push -p linux/arm64 utils xud

tools/build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#!/bin/bash
22

3-
python $(dirname "$0")/helper.py build "$@"
3+
python3 $(dirname "$0")/helper.py build "$@"

tools/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ def main():
1313
build_parser = subparsers.add_parser("build", prog="build")
1414
build_parser.add_argument("--dry-run", action="store_true")
1515
build_parser.add_argument("--no-cache", action="store_true")
16-
build_parser.add_argument("--platform", action="append")
16+
build_parser.add_argument("--platform", "-p", action="append")
1717
build_parser.add_argument("images", type=str, nargs="*")
1818

1919
push_parser = subparsers.add_parser("push")
2020
push_parser.add_argument("--dirty-push", action="store_true")
2121
push_parser.add_argument("--dry-run", action="store_true")
2222
push_parser.add_argument("--no-cache", action="store_true")
23-
push_parser.add_argument("--platform", action="append")
23+
push_parser.add_argument("--platform", "-p", action="append")
2424
push_parser.add_argument("images", type=str, nargs="*")
2525

2626
subparsers.add_parser("test")

tools/push

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ if [[ $(uname -m) == "aarch64" ]]; then
1616
fi
1717

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

0 commit comments

Comments
 (0)