CI docker tweak #65
Workflow file for this run
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: [push] | |
env: | |
LLVM_VERSION: 19.1.0 | |
jobs: | |
distros: | |
name: ${{ matrix.platform }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- debian-10 | |
- debian-11 | |
- debian-12 | |
- ubuntu-20.04 | |
- ubuntu-22.04 | |
- ubuntu-24.04 | |
- archlinux | |
steps: | |
- name: Setup docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile.${{ matrix.platform }} | |
tags: | | |
ghcr.io/blitz3d-ng/env:${{ matrix.platform }}-${{ github.ref_name }} | |
ghcr.io/blitz3d-ng/env:${{ matrix.platform }}-run${{ github.run_number }} | |
pull: true | |
push: true | |
sdks: | |
needs: [distros] | |
name: ${{ matrix.platform }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
platform: | |
- android | |
- nx | |
- mingw | |
- emscripten | |
steps: | |
- name: Setup docker | |
uses: docker/setup-buildx-action@v3 | |
- name: Log in to the GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- run: | | |
docker pull ghcr.io/blitz3d-ng/env:debian-12-run${{ github.run_number }} | |
docker tag ghcr.io/blitz3d-ng/env:debian-12-run${{ github.run_number }} ghcr.io/blitz3d-ng/env:debian-12 | |
- name: Build image | |
uses: docker/build-push-action@v6 | |
with: | |
file: Dockerfile.${{ matrix.platform }} | |
tags: ghcr.io/blitz3d-ng/env:${{ matrix.platform }}-${{ github.ref_name }} | |
pull: false | |
push: true | |
llvm_windows: | |
name: LLVM | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-2019 | |
- windows-2022 | |
arch: | |
- win64 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ilammy/msvc-dev-cmd@v1 | |
with: | |
arch: ${{ matrix.arch }} | |
- uses: seanmiddleditch/gha-setup-ninja@master | |
- shell: pwsh | |
run: .\build-llvm.ps1 | |
- shell: pwsh | |
run: Compress-Archive -Path llvm -DestinationPath llvm-${{ env.LLVM_VERSION }}-${{ matrix.arch }}-msvc${{ env.VisualStudioVersion }}.zip | |
- name: Archive build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.arch }}-msvc${{ env.VisualStudioVersion }} | |
path: llvm*msvc${{ env.VisualStudioVersion }}.zip | |
llvm_macos: | |
name: LLVM | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- macos-12 | |
- macos-13 | |
- macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
- run: brew install ninja | |
- run: ./build-llvm.sh build llvm | |
- run: zip -r llvm-${{ env.LLVM_VERSION }}-${{ matrix.os }}.zip llvm | |
- name: Archive build | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} | |
path: llvm*${{ matrix.os }}.zip | |
release: | |
name: Build release | |
runs-on: ubuntu-latest | |
needs: | |
- llvm_windows | |
- llvm_macos | |
steps: | |
- name: Get tag name | |
run: | | |
export GITHUB_TAG=$(echo ${GITHUB_REF#refs/tags/}) | |
export GITHUB_TAG=$(echo ${GITHUB_TAG#refs/heads/}) | |
echo "GITHUB_TAG=$GITHUB_TAG" >> $GITHUB_ENV | |
- uses: actions/download-artifact@v4 | |
with: | |
name: macos-12 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: macos-13 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: macos-14 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: win64-msvc16.0 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: win64-msvc17.0 | |
- name: Release | |
if: startsWith(github.ref, 'refs/tags/v') | |
uses: softprops/action-gh-release@v2 | |
with: | |
prerelease: ${{ contains(github.ref, 'beta') }} | |
generate_release_notes: false | |
files: | | |
*.zip |