[sc-24168] Fix CI #82
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
push: | |
jobs: | |
build-image: | |
name: Build Docker Image | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Login to DockerHub | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USER }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Build and export | |
uses: docker/build-push-action@v5 | |
with: | |
context: . | |
tags: gcc-cc | |
outputs: type=docker,dest=/tmp/image.tar | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: image | |
path: /tmp/image.tar | |
build-aarch64: | |
name: Build Binaries (aarch64) | |
runs-on: ubuntu-22.04 | |
needs: [build-image] | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: image | |
path: /tmp | |
- name: Load & Build | |
run: | | |
docker load --input /tmp/image.tar | |
docker run -i --name builder gcc-cc \ | |
/scripts/build-arch.sh aarch64-unknown-linux-gnu aarch64 | |
docker cp builder:/export/aarch64-unknown-linux-gnu /tmp/aarch64-unknown-linux-gnu | |
docker rm -f builder | |
- name: Check binaries | |
run: | | |
ls -lh /tmp/aarch64-unknown-linux-gnu | |
file /tmp/aarch64-unknown-linux-gnu/sccache | |
file /tmp/aarch64-unknown-linux-gnu/diesel | |
file /tmp/aarch64-unknown-linux-gnu/diesel_ext | |
file /tmp/aarch64-unknown-linux-gnu/cargo-audit | |
file /tmp/aarch64-unknown-linux-gnu/cargo-watch | |
file /tmp/aarch64-unknown-linux-gnu/cargo-dylint | |
file /tmp/aarch64-unknown-linux-gnu/dylint-link | |
file /tmp/aarch64-unknown-linux-gnu/penguin | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: aarch64 | |
path: /tmp/aarch64-unknown-linux-gnu | |
build-x86_64: | |
name: Build Binaries (x86_64) | |
runs-on: ubuntu-22.04 | |
needs: [build-image] | |
steps: | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: image | |
path: /tmp | |
- name: Load & Build | |
run: | | |
docker load --input /tmp/image.tar | |
docker run -i --name builder gcc-cc \ | |
/scripts/build-arch.sh x86_64-unknown-linux-gnu x86_64 | |
docker cp builder:/export/x86_64-unknown-linux-gnu /tmp/x86_64-unknown-linux-gnu | |
docker rm -f builder | |
- name: Check binaries | |
run: | | |
ls -lh /tmp/x86_64-unknown-linux-gnu | |
file /tmp/x86_64-unknown-linux-gnu/sccache | |
file /tmp/x86_64-unknown-linux-gnu/diesel | |
file /tmp/x86_64-unknown-linux-gnu/diesel_ext | |
file /tmp/x86_64-unknown-linux-gnu/cargo-audit | |
file /tmp/x86_64-unknown-linux-gnu/cargo-watch | |
file /tmp/x86_64-unknown-linux-gnu/cargo-dylint | |
file /tmp/x86_64-unknown-linux-gnu/dylint-link | |
file /tmp/x86_64-unknown-linux-gnu/penguin | |
/tmp/x86_64-unknown-linux-gnu/sccache --help | |
/tmp/x86_64-unknown-linux-gnu/diesel --help | |
/tmp/x86_64-unknown-linux-gnu/diesel_ext --help | |
/tmp/x86_64-unknown-linux-gnu/cargo-audit --help | |
/tmp/x86_64-unknown-linux-gnu/cargo-watch --help | |
/tmp/x86_64-unknown-linux-gnu/cargo-dylint --help | |
RUSTUP_TOOLCHAIN="stable" /tmp/x86_64-unknown-linux-gnu/dylint-link --help | |
/tmp/x86_64-unknown-linux-gnu/penguin --help | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: x86_64 | |
path: /tmp/x86_64-unknown-linux-gnu | |
create-release: | |
name: Create Release | |
runs-on: ubuntu-22.04 | |
needs: [build-aarch64, build-x86_64] | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Download binaries | |
uses: actions/download-artifact@v4 | |
- name: Check downloaded binaries (x86_64) | |
run: ls -lh x86_64/ | |
- name: Check downloaded binaries (aarch64) | |
run: ls -lh aarch64/ | |
- name: Zip binaries | |
run: zip -r x86_64.zip x86_64 && zip -r aarch64.zip aarch64 | |
- name: Extract tag name | |
run: echo GITHUB_TAG="${GITHUB_REF##refs/tags/}" >> $GITHUB_ENV | |
- name: Create release | |
uses: softprops/action-gh-release@v2 | |
with: | |
files: | | |
x86_64.zip | |
aarch64.zip | |
name: ${{ env.GITHUB_TAG }} |