diff --git a/.github/workflows/cia-unix-build.yml b/.github/workflows/cia-unix-build.yml index 0bb637c..1ff4337 100644 --- a/.github/workflows/cia-unix-build.yml +++ b/.github/workflows/cia-unix-build.yml @@ -11,33 +11,48 @@ jobs: strategy: matrix: include: - # Linux x86-64 + # Linux x86-64 - os: ubuntu-latest artifact_name: ${{ github.event.repository.name }} asset_name: ${{ github.event.repository.name }}-linux-x86_64 - # Linux arm64 + # Linux arm64 - os: ubuntu-22.04-arm artifact_name: ${{ github.event.repository.name }} asset_name: ${{ github.event.repository.name }}-linux-arm64 - # macOS x86-64 + # macOS x86-64 - os: macos-13 artifact_name: ${{ github.event.repository.name }} asset_name: ${{ github.event.repository.name }}-macos-x86_64 - # macOS arm64 + # macOS arm64 - os: macos-latest artifact_name: ${{ github.event.repository.name }} asset_name: ${{ github.event.repository.name }}-macos-arm64 + runs-on: ${{ matrix.os }} steps: - - name: Install crystal - uses: crystal-lang/install-crystal@v1 - - uses: actions/checkout@v4 - - name: Build release - run: | - crystal build ${{ matrix.artifact_name }}.cr --release --no-debug - strip ${{ matrix.artifact_name }} - - name: Upload artifacts - uses: actions/upload-artifact@v4.3.3 - with: - name: ${{ matrix.asset_name }} - path: ${{ matrix.artifact_name}} + - uses: actions/checkout@v4 + + - name: Install Crystal for linux-arm64 + if: matrix.os == 'ubuntu-22.04-arm' + run: | + curl -fsSL https://packagecloud.io/84codes/crystal/gpgkey | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/84codes_crystal.gpg > /dev/null + . /etc/os-release + echo "deb https://packagecloud.io/84codes/crystal/$ID $VERSION_CODENAME main" | sudo tee /etc/apt/sources.list.d/84codes_crystal.list + sudo apt-get update + sudo apt-get install crystal + + - name: Install Crystal for linux-x86_64 and macOS + if: matrix.os != 'ubuntu-22.04-arm' + uses: crystal-lang/install-crystal@v1 + + - name: Build release + run: | + crystal build ${{ matrix.artifact_name }}.cr --release --no-debug + strip ${{ matrix.artifact_name }} + + - name: Upload artifacts + uses: actions/upload-artifact@v4.3.3 + with: + name: ${{ matrix.asset_name }} + path: ${{ matrix.artifact_name }} +