@@ -22,71 +22,29 @@ jobs:
2222 release_name : Release ${{ github.ref }}
2323 draft : false
2424 prerelease : false
25- build_x86_64 :
26- name : Upload Release x86-64
25+ upload_release :
26+ name : Upload Release
2727 needs : create_release
28- runs-on : ubuntu-latest
2928 strategy :
3029 matrix :
31- include :
32- - target : x86_64-unknown-linux-gnu
33- cc : gcc
30+ arch : [x86_64, aarch64]
31+ runs-on : ${{ fromJson('{"x86_64":"ubuntu-latest", "aarch64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }}
3432 steps :
3533 - name : Checkout code
3634 uses : actions/checkout@v2
3735 - name : Build
3836 run : |
39- DOCKER_BUILDKIT=1 docker build --build-arg CC=${{ matrix.cc }} --build-arg TARGET=${{ matrix.target }} --build-arg HTTP_PROXY=${HTTP_PROXY} --build-arg HTTPS_PROXY=${HTTPS_PROXY} . -t chaos-mesh/tproxy
37+ DOCKER_BUILDKIT=1 docker build --build-arg HTTP_PROXY=${HTTP_PROXY} --build-arg HTTPS_PROXY=${HTTPS_PROXY} . -t chaos-mesh/tproxy
4038 docker run -v ${PWD}:/opt/mount:z --rm --entrypoint cp chaos-mesh/tproxy /tproxy /opt/mount/tproxy
41- tar -czvf ./tproxy-${{ matrix.target }}.tar.gz ./tproxy
39+ tar -czvf ./tproxy-${{ matrix.arch }}.tar.gz ./tproxy
4240 - name : Upload Release Asset
4341 id : upload-release-asset
4442 uses : actions/upload-release-asset@v1
4543 env :
4644 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4745 with :
4846 upload_url : ${{ needs.create_release.outputs.upload_url }}
49- asset_path : ./tproxy-${{ matrix.target }}.tar.gz
50- asset_name : tproxy-${{ matrix.target }}.tar.gz
47+ asset_path : ./tproxy-${{ matrix.arch }}.tar.gz
48+ asset_name : tproxy-${{ matrix.arch }}.tar.gz
5149 asset_content_type : application/zip
52- build_aarch64 :
53- name : Upload Release aarch64
54- needs : create_release
55- runs-on : ubuntu-latest
56- strategy :
57- matrix :
58- include :
59- - target : aarch64-unknown-linux-gnu
60- cc : gcc-aarch64-linux-gnu
61- steps :
62- - name : Checkout code
63- uses : actions/checkout@v2
64- - name : Build
65- uses : uraimo/run-on-arch-action@v2
66- with :
67- arch : aarch64
68- distro : ubuntu20.04
69- githubToken : ${{ secrets.GITHUB_TOKEN }}
70- setup : |
71- mkdir -p $HOME/tproxy
72- dockerRunArgs : |
73- --volume "$HOME/tproxy:/tproxy"
74- run : |
75- apt update
76- apt install build-essential ${{ matrix.cc }} curl git pkg-config -y
77- rm -rf /var/lib/apt/lists/*
78- curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
79- source $HOME/.cargo/env
80- cargo build --release --all
81- cp ./target/release/chaos-tproxy /tproxy/tproxy
82- tar -czvf /tproxy/tproxy-${{ matrix.target }}.tar.gz /tproxy/tproxy
83- - name : Upload Release Asset
84- id : upload-release-asset
85- uses : actions/upload-release-asset@v1
86- env :
87- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
88- with :
89- upload_url : ${{ needs.create_release.outputs.upload_url }}
90- asset_path : $HOME/tproxy-${{ matrix.target }}.tar.gz
91- asset_name : tproxy-${{ matrix.target }}.tar.gz
92- asset_content_type : application/zip
50+
0 commit comments