diff --git a/.github/workflows/container.yml b/.github/workflows/container.yml index 68af7bab..979ee5b7 100644 --- a/.github/workflows/container.yml +++ b/.github/workflows/container.yml @@ -7,17 +7,17 @@ on: pull_request: branches: [ "*" ] -# env: -# REGISTRY: ghcr.io -# EULIX_REGISTRY: hub.eulix.xyz -# HUAWEICLOUD_REGISTRY_SH: swr.cn-east-3.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_BJ: swr.cn-north-4.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_GZ: swr.cn-south-1.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_HK: swr.ap-southeast-1.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_SG: swr.ap-southeast-3.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_AF: swr.af-south-1.myhuaweicloud.com -# HUAWEICLOUD_REGISTRY_LA: swr.la-north-2.myhuaweicloud.com -# IMAGE_NAME: ${{ github.repository }} +env: + REGISTRY: ghcr.io + EULIX_REGISTRY: hub.eulix.xyz + HUAWEICLOUD_REGISTRY_SH: swr.cn-east-3.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_BJ: swr.cn-north-4.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_GZ: swr.cn-south-1.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_HK: swr.ap-southeast-1.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_SG: swr.ap-southeast-3.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_AF: swr.af-south-1.myhuaweicloud.com + HUAWEICLOUD_REGISTRY_LA: swr.la-north-2.myhuaweicloud.com + IMAGE_NAME: ${{ github.repository }} jobs: @@ -127,355 +127,350 @@ jobs: release/* - # build-liunx: - # runs-on: ubuntu-22.04 - # permissions: - # contents: read - # packages: write - # id-token: write - - # steps: - # - name: clean-space - # run: |- - # sudo swapoff -a - # sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc - # sudo apt clean - # sudo df -Th - # # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive - - # - name: Set up Go - # uses: actions/setup-go@v4 - # with: - # go-version: 'stable' - - # - name: package-gt - # run: |- - # sudo apt-get update && sudo apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu rustc upx -y - # rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu riscv64gc-unknown-linux-gnu - # make - - # - name: Archive GT artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gt-linux - # path: | - # release/* - # - name: clean-space - # run: sudo rm -rf /home/runner/work/gt/gt/libcs/dep - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v2 - - # - name: Setup Docker buildx - # uses: docker/setup-buildx-action@v2 - - # - run: echo "GITHUB_REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV - # shell: bash - - # - name: Inspect builder - # run: | - # echo "Name: ${{ steps.buildx.outputs.name }}" - # echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" - # echo "Status: ${{ steps.buildx.outputs.status }}" - # echo "Flags: ${{ steps.buildx.outputs.flags }}" - # echo "Platforms: ${{ steps.buildx.outputs.platforms }}" - - # - name: Log into registry ${{ env.REGISTRY }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.REGISTRY }} - # username: ${{ github.actor }} - # password: ${{ secrets.GITHUB_TOKEN }} - - # - name: Log into registry ${{ env.EULIX_REGISTRY }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.EULIX_REGISTRY }} - # username: ${{ secrets.EULIX_REGISTRY_USERNAME }} - # password: ${{ secrets.EULIX_REGISTRY_PASSWORD }} - - # - name: Log into registry Docker Hub - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }} - # password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SH }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_SH }} - # username: cn-east-3@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_BJ }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_BJ }} - # username: cn-north-4@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_GZ }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_GZ }} - # username: cn-south-1@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SG }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_SG }} - # username: ap-southeast-3@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_HK }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_HK }} - # username: ap-southeast-1@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_AF }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_AF }} - # username: af-south-1@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_LA }} - # if: github.event_name != 'pull_request' - # uses: docker/login-action@v2 - # with: - # registry: ${{ env.HUAWEICLOUD_REGISTRY_LA }} - # username: la-north-2@${{ secrets.HUAWEICLOUD_USERNAME }} - # password: ${{ secrets.HUAWEICLOUD_PASSWORD }} - - # - name: Extract Docker metadata for Server - # id: meta-server - # uses: docker/metadata-action@v2 - # with: - # images: | - # ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }} - # aospace/${{ env.GITHUB_REPOSITORY_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }} - # flavor: | - # prefix=server- - - # - name: Build and push Docker image for Server - # id: build-and-push-server - # uses: docker/build-push-action@v4.2.1 - # with: - # context: . - # push: ${{ github.event_name != 'pull_request' }} - # tags: ${{ steps.meta-server.outputs.tags }} - # labels: ${{ steps.meta-server.outputs.labels }} - # builder: ${{ steps.buildx.outputs.name }} - # platforms: linux/amd64,linux/arm64,linux/riscv64 - # cache-from: type=gha - # cache-to: type=gha,mode=max - # file: Dockerfile-server - # provenance: false - - # - name: Extract Docker metadata for Client - # id: meta-client - # uses: docker/metadata-action@v2 - # with: - # images: | - # ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} - # ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }} - # aospace/${{ env.GITHUB_REPOSITORY_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }} - # ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }} - # flavor: | - # prefix=client- - - # - name: Build and push Docker image for Client - # id: build-and-push-client - # uses: docker/build-push-action@v4.2.1 - # with: - # context: . - # push: ${{ github.event_name != 'pull_request' }} - # tags: ${{ steps.meta-client.outputs.tags }} - # labels: ${{ steps.meta-client.outputs.labels }} - # builder: ${{ steps.buildx.outputs.name }} - # platforms: linux/amd64,linux/arm64,linux/riscv64 - # cache-from: type=gha - # cache-to: type=gha,mode=max - # file: Dockerfile-client - # provenance: false - - # - name: Extract Docker metadata for Server - # id: meta-opensource-server - # uses: docker/metadata-action@v2 - # with: - # images: | - # ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-server - # flavor: | - # prefix=opensource-server- - - # - name: Build and push Docker image for Server - # id: build-and-push-opensource-server - # uses: docker/build-push-action@v2 - # with: - # context: . - # push: ${{ github.event_name != 'pull_request' }} - # tags: ${{ steps.meta-opensource-server.outputs.tags }} - # labels: ${{ steps.meta-opensource-server.outputs.labels }} - # builder: ${{ steps.buildx.outputs.name }} - # platforms: linux/amd64,linux/arm64,linux/riscv64 - # cache-from: type=gha - # cache-to: type=gha,mode=max - # file: Dockerfile-server - - # - name: Extract Docker metadata for Client - # id: meta-opensource-client - # uses: docker/metadata-action@v2 - # with: - # images: | - # ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-client - # flavor: | - # prefix=opensource-client- - - # - name: Build and push Docker image for Client - # id: build-and-push-opensource-client - # uses: docker/build-push-action@v2 - # with: - # context: . - # push: ${{ github.event_name != 'pull_request' }} - # tags: ${{ steps.meta-opensource-client.outputs.tags }} - # labels: ${{ steps.meta-opensource-client.outputs.labels }} - # builder: ${{ steps.buildx.outputs.name }} - # platforms: linux/amd64,linux/arm64,linux/riscv64 - # cache-from: type=gha - # cache-to: type=gha,mode=max - # file: Dockerfile-client - - # build-x8664-macos: - # runs-on: macos-13 - # permissions: - # contents: read - # packages: write - # id-token: write - - # # steps: - # # - name: space - # # shell: bash - # # run: |- - # # sudo df -h + build-liunx: + runs-on: ubuntu-22.04 + permissions: + contents: read + packages: write + id-token: write + + steps: + - name: clean-space + run: |- + sudo swapoff -a + sudo rm -rf /swapfile /usr/share/dotnet /usr/local/lib/android /opt/ghc + sudo apt clean + sudo df -Th + # steps: + - uses: actions/checkout@v3 + with: + submodules: recursive + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' + + - name: package-gt + run: |- + sudo apt-get update && sudo apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu rustc upx -y + rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu riscv64gc-unknown-linux-gnu + make + + - name: Archive GT artifacts + uses: actions/upload-artifact@v3 + with: + name: gt-linux + path: | + release/* + - name: clean-space + run: sudo rm -rf /home/runner/work/gt/gt/libcs/dep + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Setup Docker buildx + uses: docker/setup-buildx-action@v2 + + - run: echo "GITHUB_REPOSITORY_NAME=${GITHUB_REPOSITORY#*/}" >> $GITHUB_ENV + shell: bash + + - name: Inspect builder + run: | + echo "Name: ${{ steps.buildx.outputs.name }}" + echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}" + echo "Status: ${{ steps.buildx.outputs.status }}" + echo "Flags: ${{ steps.buildx.outputs.flags }}" + echo "Platforms: ${{ steps.buildx.outputs.platforms }}" + + - name: Log into registry ${{ env.REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.REGISTRY }} + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Log into registry ${{ env.EULIX_REGISTRY }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.EULIX_REGISTRY }} + username: ${{ secrets.EULIX_REGISTRY_USERNAME }} + password: ${{ secrets.EULIX_REGISTRY_PASSWORD }} + + - name: Log into registry Docker Hub + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKER_HUB_REGISTRY_USERNAME }} + password: ${{ secrets.DOCKER_HUB_REGISTRY_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SH }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_SH }} + username: cn-east-3@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_BJ }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_BJ }} + username: cn-north-4@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_GZ }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_GZ }} + username: cn-south-1@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_SG }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_SG }} + username: ap-southeast-3@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_HK }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_HK }} + username: ap-southeast-1@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_AF }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_AF }} + username: af-south-1@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Log into registry ${{ env.HUAWEICLOUD_REGISTRY_LA }} + if: github.event_name != 'pull_request' + uses: docker/login-action@v2 + with: + registry: ${{ env.HUAWEICLOUD_REGISTRY_LA }} + username: la-north-2@${{ secrets.HUAWEICLOUD_USERNAME }} + password: ${{ secrets.HUAWEICLOUD_PASSWORD }} + + - name: Extract Docker metadata for Server + id: meta-server + uses: docker/metadata-action@v2 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }} + aospace/${{ env.GITHUB_REPOSITORY_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }} + flavor: | + prefix=server- + + - name: Build and push Docker image for Server + id: build-and-push-server + uses: docker/build-push-action@v4.2.1 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-server.outputs.tags }} + labels: ${{ steps.meta-server.outputs.labels }} + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64,linux/riscv64 + cache-from: type=gha + cache-to: type=gha,mode=max + file: Dockerfile-server + provenance: false + + - name: Extract Docker metadata for Client + id: meta-client + uses: docker/metadata-action@v2 + with: + images: | + ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} + ${{ env.EULIX_REGISTRY }}/${{ env.IMAGE_NAME }} + aospace/${{ env.GITHUB_REPOSITORY_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_SH }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_BJ }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_GZ }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_HK }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_SG }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_AF }}/${{ env.IMAGE_NAME }} + ${{ env.HUAWEICLOUD_REGISTRY_LA }}/${{ env.IMAGE_NAME }} + flavor: | + prefix=client- + + - name: Build and push Docker image for Client + id: build-and-push-client + uses: docker/build-push-action@v4.2.1 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-client.outputs.tags }} + labels: ${{ steps.meta-client.outputs.labels }} + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64,linux/riscv64 + cache-from: type=gha + cache-to: type=gha,mode=max + file: Dockerfile-client + provenance: false + + - name: Extract Docker metadata for Server + id: meta-opensource-server + uses: docker/metadata-action@v2 + with: + images: | + ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-server + flavor: | + prefix=opensource-server- + + - name: Build and push Docker image for Server + id: build-and-push-opensource-server + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-opensource-server.outputs.tags }} + labels: ${{ steps.meta-opensource-server.outputs.labels }} + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64,linux/riscv64 + cache-from: type=gha + cache-to: type=gha,mode=max + file: Dockerfile-server + + - name: Extract Docker metadata for Client + id: meta-opensource-client + uses: docker/metadata-action@v2 + with: + images: | + ${{ env.EULIX_REGISTRY }}/cicada-private/aonetwork-client + flavor: | + prefix=opensource-client- + + - name: Build and push Docker image for Client + id: build-and-push-opensource-client + uses: docker/build-push-action@v2 + with: + context: . + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ steps.meta-opensource-client.outputs.tags }} + labels: ${{ steps.meta-opensource-client.outputs.labels }} + builder: ${{ steps.buildx.outputs.name }} + platforms: linux/amd64,linux/arm64,linux/riscv64 + cache-from: type=gha + cache-to: type=gha,mode=max + file: Dockerfile-client + + build-x8664-macos: + runs-on: macos-13 + permissions: + contents: read + packages: write + id-token: write + - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - # - name: Set up Go - # uses: actions/setup-go@v4 - # with: - # go-version: 'stable' - - # - name: package-gt - # run: |- - # sudo mkdir -pv /opt/homebrew/opt - # brew install make llvm@16 binutils ninja - # pip3 install --upgrade setuptools - # curl -LOJ https://chrome-infra-packages.appspot.com/dl/gn/gn/mac-amd64/+/latest - # unzip gn-mac-amd64.zip - # chmod +x gn && mv gn /usr/local/opt/llvm@16/bin/ - # sudo ln -s /usr/local/opt/llvm@16 /opt/homebrew/opt/llvm - # ln -s /usr/local/opt/llvm@16 /usr/local/opt/llvm - # echo 'export PATH="/usr/local/opt/llvm@16/bin:$PATH"' >> ~/.bash_profile - # export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" - # echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> ~/.bash_profile - # source ~/.bash_profile - # mv /usr/local/opt/llvm/bin/llvm-libtool-darwin /usr/local/opt/llvm/bin/libtool - # rustup target add x86_64-apple-darwin aarch64-apple-darwin - # cd ./libcs && TARGET=x86_64-apple-darwin GOOS=darwin GOARCH=amd64 arch -arch x86_64 make release_lib - # cargo build --target x86_64-apple-darwin -r - # cd .. - # mkdir -p release - # cp target/x86_64-apple-darwin/release/gt release/gt-macos-x86_64 - - # - name: Archive GT artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gt-macos-x86_64 - # path: | - # release/* - - # build-arm64-macos: - # runs-on: macos-14 - # permissions: - # contents: read - # packages: write - # id-token: write - - # # steps: - # # - name: space - # # shell: bash - # # run: |- - # # sudo df -h + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' + + - name: package-gt + run: |- + sudo mkdir -pv /opt/homebrew/opt + brew install make llvm@16 binutils ninja + pip3 install --upgrade setuptools + curl -LOJ https://chrome-infra-packages.appspot.com/dl/gn/gn/mac-amd64/+/latest + unzip gn-mac-amd64.zip + chmod +x gn && mv gn /usr/local/opt/llvm@16/bin/ + sudo ln -s /usr/local/opt/llvm@16 /opt/homebrew/opt/llvm + ln -s /usr/local/opt/llvm@16 /usr/local/opt/llvm + echo 'export PATH="/usr/local/opt/llvm@16/bin:$PATH"' >> ~/.bash_profile + export PATH="/usr/local/opt/make/libexec/gnubin:$PATH" + echo 'export PATH="/usr/local/opt/binutils/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile + mv /usr/local/opt/llvm/bin/llvm-libtool-darwin /usr/local/opt/llvm/bin/libtool + rustup target add x86_64-apple-darwin aarch64-apple-darwin + cd ./libcs && TARGET=x86_64-apple-darwin GOOS=darwin GOARCH=amd64 arch -arch x86_64 make release_lib + cargo build --target x86_64-apple-darwin -r + cd .. + mkdir -p release + cp target/x86_64-apple-darwin/release/gt release/gt-macos-x86_64 + + - name: Archive GT artifacts + uses: actions/upload-artifact@v3 + with: + name: gt-macos-x86_64 + path: | + release/* + + build-arm64-macos: + runs-on: macos-14 + permissions: + contents: read + packages: write + id-token: write + + # steps: + # - name: space + # shell: bash + # run: |- + # sudo df -h - # steps: - # - uses: actions/checkout@v3 - # with: - # submodules: recursive + steps: + - uses: actions/checkout@v3 + with: + submodules: recursive - # - name: Set up Go - # uses: actions/setup-go@v4 - # with: - # go-version: 'stable' - - # - name: package-gt - # run: |- - # brew install make llvm@16 binutils ninja - # curl -LOJ https://chrome-infra-packages.appspot.com/dl/gn/gn/mac-amd64/+/latest - # unzip gn-mac-amd64.zip - # chmod +x gn && mv gn /opt/homebrew/opt/llvm@16/bin/ - # ln -s /opt/homebrew/opt/llvm@16 /opt/homebrew/opt/llvm - # echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile - # export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" - # echo 'export PATH="/opt/homebrew/opt/binutils/bin:$PATH"' >> ~/.bash_profile - # source ~/.bash_profile - # mv /opt/homebrew/opt/llvm/bin/llvm-libtool-darwin /opt/homebrew/opt/llvm/bin/libtool - # rustup target add x86_64-apple-darwin aarch64-apple-darwin - # cd ./libcs && TARGET=aarch64-apple-darwin GOOS=darwin GOARCH=arm64 arch -arch arm64 make release_lib - # cargo build --target aarch64-apple-darwin -r - # cd .. - # mkdir -p release - # cp target/aarch64-apple-darwin/release/gt release/gt-macos-aarch64 - - # - name: Archive GT artifacts - # uses: actions/upload-artifact@v3 - # with: - # name: gt-macos-aarch64 - # path: | - # release/* + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: 'stable' + + - name: package-gt + run: |- + brew install make llvm@16 binutils ninja + curl -LOJ https://chrome-infra-packages.appspot.com/dl/gn/gn/mac-amd64/+/latest + unzip gn-mac-amd64.zip + chmod +x gn && mv gn /opt/homebrew/opt/llvm@16/bin/ + ln -s /opt/homebrew/opt/llvm@16 /opt/homebrew/opt/llvm + echo 'export PATH="/opt/homebrew/opt/llvm/bin:$PATH"' >> ~/.bash_profile + export PATH="/opt/homebrew/opt/make/libexec/gnubin:$PATH" + echo 'export PATH="/opt/homebrew/opt/binutils/bin:$PATH"' >> ~/.bash_profile + source ~/.bash_profile + mv /opt/homebrew/opt/llvm/bin/llvm-libtool-darwin /opt/homebrew/opt/llvm/bin/libtool + rustup target add x86_64-apple-darwin aarch64-apple-darwin + cd ./libcs && TARGET=aarch64-apple-darwin GOOS=darwin GOARCH=arm64 arch -arch arm64 make release_lib + cargo build --target aarch64-apple-darwin -r + cd .. + mkdir -p release + cp target/aarch64-apple-darwin/release/gt release/gt-macos-aarch64 + + - name: Archive GT artifacts + uses: actions/upload-artifact@v3 + with: + name: gt-macos-aarch64 + path: | + release/*