refactor: rewrite ci workflows
Build Container Image / push_msvc_amd64 (push) Has been cancelled Details
Build Container Image / build_msvc_i386 (push) Has been cancelled Details
Build Container Image / push_msvc_i386 (push) Has been cancelled Details
Build Container Image / push_msvc_arm64 (push) Has been cancelled Details
Build Container Image / build_mingw_amd64 (push) Has been cancelled Details
Build Container Image / push_mingw_amd64 (push) Has been cancelled Details
Build Container Image / build_mingw_i386 (push) Has been cancelled Details
Build Container Image / push_mingw_i386 (push) Has been cancelled Details
Build Container Image / build_mingw_arm64 (push) Has been cancelled Details
Build Container Image / push_mingw_arm64 (push) Has been cancelled Details
Build Container Image / build_msvc (push) Has been cancelled Details
Build Container Image / build_mingw (push) Has been cancelled Details
Build Container Image / push_mingw (push) Has been cancelled Details
Build Container Image / update_readme (push) Has been cancelled Details
Build Container Image / build_msvc_arm64 (push) Has been cancelled Details
Build Container Image / build_msvc_amd64 (push) Has been cancelled Details

This commit is contained in:
Daniel Wolf 2024-03-27 16:33:34 -04:00
parent 3362105d21
commit 5cb1a472b7
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
3 changed files with 442 additions and 279 deletions

View File

@ -9,134 +9,8 @@ on:
schedule:
- cron: '40 20 * * 3'
jobs:
build_amd64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/amd64
provenance: false
pull: true
push: true
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows:mingw-amd64
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-amd64
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-amd64,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-amd64 --platform linux/amd64 --target=mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (X86_64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_i386:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-i386
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/386
provenance: false
pull: true
push: true
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows:mingw-i386
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-i386
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-i386
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-i386,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-i386 --platform linux/386 --target=mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (I686)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
build_arm64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/arm64/v8
provenance: false
pull: true
push: true
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows:mingw-arm64
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-arm64
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-arm64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-arm64,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-arm64 --platform linux/arm64/v8 --target=mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (AARCH64)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
msvc_amd64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
build_msvc_amd64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
continue-on-error: true
steps:
@ -151,6 +25,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -160,25 +39,42 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-windows:msvc-amd64
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-amd64
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-amd64,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-amd64 --platform linux/amd64 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-amd64 --platform linux/amd64 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (X86_64; MSVC)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
msvc_i386:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_msvc_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_msvc_amd64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc --platform linux/amd64
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc nephatrine/amd64:nxb-cross-windows-msvc
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc
docker push nephatrine/amd64:nxb-cross-windows-msvc
docker rmi nephatrine/amd64:nxb-cross-windows-msvc
build_msvc_i386:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-i386
continue-on-error: true
steps:
@ -193,6 +89,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -202,25 +103,42 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-windows:msvc-i386
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-i386
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-i386
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-i386,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-i386 --platform linux/386 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-i386 --platform linux/386 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (I686; MSVC)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
msvc_arm64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_msvc_i386:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_msvc_i386]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc --platform linux/386
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc nephatrine/ia32:nxb-cross-windows-msvc
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc
docker push nephatrine/ia32:nxb-cross-windows-msvc
docker rmi nephatrine/ia32:nxb-cross-windows-msvc
build_msvc_arm64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
continue-on-error: true
steps:
@ -235,6 +153,11 @@ jobs:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
@ -244,78 +167,317 @@ jobs:
provenance: false
pull: true
push: true
tags: code.nephatrine.net/nephnet/nxb-cross-windows:msvc-arm64
cache-from: |
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:mingw-arm64
type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-arm64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-cache:msvc-arm64,mode=max
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-arm64 --platform linux/arm64/v8 ${{ gitea.workspace }}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-msvc-arm64 --platform linux/arm64/v8 -f Dockerfile ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (AARCH64; MSVC)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
msvc_manifest:
push_msvc_arm64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [msvc_amd64, msvc_i386, msvc_arm64]
needs: [build_msvc_arm64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: docker buildx imagetools create -t code.nephatrine.net/nephnet/nxb-cross-windows:msvc code.nephatrine.net/nephnet/nxb-cross-windows:msvc-amd64 code.nephatrine.net/nephnet/nxb-cross-windows:msvc-i386 code.nephatrine.net/nephnet/nxb-cross-windows:msvc-arm64
build_manifest:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64, build_i386, build_arm64]
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc --platform linux/arm64/v8
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc nephatrine/arm64:nxb-cross-windows-msvc
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc
docker push nephatrine/arm64:nxb-cross-windows-msvc
docker rmi nephatrine/arm64:nxb-cross-windows-msvc
build_mingw_amd64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Check Base Image
if: gitea.event_name == 'schedule'
uses: https://github.com/lucacome/docker-image-update-checker@v1
id: checkbase
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
base-image: nephatrine/nxbuilder:llvm17-stable
image: nephatrine/nxbuilder:cross-windows
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/amd64
- name: Docker Login
uses: https://github.com/docker/login-action@v3
provenance: false
pull: true
push: true
file: Dockerfile
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-amd64 --platform linux/amd64 -f Dockerfile --target mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
title: "Container Build (X86_64; MINGW)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_mingw_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_mingw_amd64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: docker buildx imagetools create -t code.nephatrine.net/nephnet/nxb-cross-windows:latest -t code.nephatrine.net/nephnet/nxb-cross-windows:mingw -t nephatrine/nxbuilder:cross-windows code.nephatrine.net/nephnet/nxb-cross-windows:mingw-amd64 code.nephatrine.net/nephnet/nxb-cross-windows:mingw-i386 code.nephatrine.net/nephnet/nxb-cross-windows:mingw-arm64
- name: Notify Discord
if: gitea.event_name != 'schedule' || steps.checkbase.outputs.needs-updating == 'true'
uses: https://github.com/sarisia/actions-status-discord@v1
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw --platform linux/amd64
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw nephatrine/amd64:nxb-cross-windows-mingw
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw
docker push nephatrine/amd64:nxb-cross-windows-mingw
docker rmi nephatrine/amd64:nxb-cross-windows-mingw
build_mingw_i386:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-i386
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
title: "DockerHub: nxb-cross-windows"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxbuilder/general).\nPull `nephatrine/nxbuilder:cross-windows` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/386
provenance: false
pull: true
push: true
file: Dockerfile
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-i386 --platform linux/386 -f Dockerfile --target mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish"
title: "Container Build (I686; MINGW)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_mingw_i386:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_mingw_i386]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw --platform linux/386
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw nephatrine/ia32:nxb-cross-windows-mingw
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw
docker push nephatrine/ia32:nxb-cross-windows-mingw
docker rmi nephatrine/ia32:nxb-cross-windows-mingw
build_mingw_arm64:
if: gitea.repository_owner == 'NephNET' && (!(startsWith(gitea.event.head_commit.message, 'chore') || startsWith(gitea.event.head_commit.message, 'docs')) || gitea.event_name == 'schedule')
runs-on: nephnet-arm64
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: BuildX Setup
uses: https://github.com/docker/setup-buildx-action@v3
- name: Docker Login
uses: https://github.com/docker/login-action@v3
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Login (Pull Auth)
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
context: .
platforms: linux/arm64/v8
provenance: false
pull: true
push: true
file: Dockerfile
target: mingw
tags: code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
export BRANCH=${GITHUB_REF##*/}
export BRANCH=${BRANCH:-unknown}
docker buildx build --pull -t code.nephatrine.net/nephnet/nxb-cross-windows:${BRANCH}-mingw-arm64 --platform linux/arm64/v8 -f Dockerfile --target mingw ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (AARCH64; MINGW)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_mingw_arm64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_mingw_arm64]
runs-on: nephnet-amd64
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw --platform linux/arm64/v8
docker tag code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw nephatrine/arm64:nxb-cross-windows-mingw
docker rmi code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw
docker push nephatrine/arm64:nxb-cross-windows-mingw
docker rmi nephatrine/arm64:nxb-cross-windows-mingw
build_msvc:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_msvc_amd64, build_msvc_i386, build_msvc_arm64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create code.nephatrine.net/nephnet/nxb-cross-windows:latest --amend code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc --amend code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc --amend code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc
docker manifest create code.nephatrine.net/nephnet/nxb-cross-windows:msvc --amend code.nephatrine.net/nephnet/nxb-cross-windows-amd64:msvc --amend code.nephatrine.net/nephnet/nxb-cross-windows-i386:msvc --amend code.nephatrine.net/nephnet/nxb-cross-windows-arm64:msvc
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-windows:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-windows:msvc
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (MSVC)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
build_mingw:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_mingw_amd64, build_mingw_i386, build_mingw_arm64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
registry: code.nephatrine.net
username: ${{ gitea.actor }}
password: ${{ secrets.PACKAGER_TOKEN }}
- name: Docker Manifest
run: |
docker manifest create code.nephatrine.net/nephnet/nxb-cross-windows:mingw --amend code.nephatrine.net/nephnet/nxb-cross-windows-amd64:mingw --amend code.nephatrine.net/nephnet/nxb-cross-windows-i386:mingw --amend code.nephatrine.net/nephnet/nxb-cross-windows-arm64:mingw
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-windows:mingw
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (MINGW)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
push_mingw:
needs: [push_mingw_amd64, push_mingw_i386, push_mingw_arm64]
runs-on: nephnet
continue-on-error: true
steps:
- name: Docker Login
uses: https://github.com/docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
- name: Docker Manifest
run: |
docker manifest create nephatrine/nxbuilder:debian-mingw --amend nephatrine/amd64:nxb-cross-windows-mingw --amend nephatrine/ia32:nxb-cross-windows-mingw --amend nephatrine/arm64:nxb-cross-windows-mingw
docker manifest create nephatrine/nxb-cross-windows:latest --amend nephatrine/amd64:nxb-cross-windows-mingw --amend nephatrine/ia32:nxb-cross-windows-mingw --amend nephatrine/arm64:nxb-cross-windows-mingw
docker manifest create nephatrine/nxb-cross-windows:mingw --amend nephatrine/amd64:nxb-cross-windows-mingw --amend nephatrine/ia32:nxb-cross-windows-mingw --amend nephatrine/arm64:nxb-cross-windows-mingw
docker manifest push --purge nephatrine/nxbuilder:debian-mingw
docker manifest push --purge nephatrine/nxb-cross-windows:latest
docker manifest push --purge nephatrine/nxb-cross-windows:mingw
- name: Notify Discord
if: gitea.event_name != 'schedule'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: nxb-cross-windows (MINGW)"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxb-cross-windows/general).\nPull `nephatrine/nxb-cross-windows:mingw` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
update_readme:
needs: [push_mingw]
runs-on: nephnet
continue-on-error: true
steps:
- name: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
- name: Docker Describe
uses: https://github.com/peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASS }}
repository: nephatrine/nxb-cross-windows

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: ISC
FROM code.nephatrine.net/nephnet/nxb-debian:llvm17-stable AS winebox
FROM code.nephatrine.net/nephnet/nxb-debian:llvm-stable AS winebox
ENV WINEDEBUG=fixme-all \
WINE=/usr/bin/wine \
@ -19,8 +19,8 @@ RUN echo "====== INSTALL WINE ======" \
&& apt-get -o Dpkg::Options::="--force-confnew" install -y --no-install-recommends wine wine-binfmt \
&& apt-get autoremove -y && apt-get clean \
&& export WINEDLLOVERRIDES="mscoree,mshtml=" \
&& DISPLAY= ${WINE} wineboot --init \
&& while pgrep -f ${WINESERVER} >/dev/null; do sleep 5; done \
&& DISPLAY="${WINE}" wineboot --init \
&& while pgrep -f "${WINESERVER}" >/dev/null; do sleep 5; done \
&& rm -rf /tmp/* /var/tmp/*
ENV WINDOWS_SYSROOT=${WINEPREFIX}/drive_c
@ -31,67 +31,67 @@ RUN echo "====== INSTALL PACKAGING TOOLS ======" \
&& rm -rf /tmp/* /var/tmp/*
RUN echo "====== BUILD MSIX TOOLS ======" \
&& if [ ! "$(uname -m)" = "i686" ]; then git -C ${HOME} clone --single-branch --depth=1 https://github.com/microsoft/msix-packaging.git \
&& cd ${HOME}/msix-packaging && ./makelinux.sh --pack --validation-parser --skip-samples --skip-tests \
&& mkdir /usr/local/lib/$(uname -m)-linux-gnu && cp -nv .vs/lib/*.so /usr/local/lib/$(uname -m)-linux-gnu/ && ldconfig \
&& if [ ! "$(uname -m)" = "i686" ]; then git -C "${HOME}" clone --single-branch --depth=1 https://github.com/microsoft/msix-packaging.git \
&& cd "${HOME}/msix-packaging" && ./makelinux.sh --pack --validation-parser --skip-samples --skip-tests \
&& mkdir "/usr/local/lib/$(uname -m)-linux-gnu" && cp -nv .vs/lib/*.so "/usr/local/lib/$(uname -m)-linux-gnu/" && ldconfig \
&& cp -nv .vs/bin/makemsix /usr/local/bin/ \
&& rm -rf /tmp/* /var/tmp/* ${HOME}/msix-packaging; fi
&& rm -rf /tmp/* /var/tmp/* "${HOME}/msix-packaging"; fi
FROM winebox AS mingw
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
RUN echo "====== BUILD UASM ======" \
&& git -C ${HOME} clone --single-branch --depth=1 -b 'v2.56' https://github.com/Terraspace/UASM.git \
&& cd ${HOME}/UASM \
&& git -C "${HOME}" clone --single-branch --depth=1 -b 'v2.56' https://github.com/Terraspace/UASM.git \
&& cd "${HOME}/UASM" \
&& make -j$(( $(getconf _NPROCESSORS_ONLN) / 2 + 1 )) -f gccLinux64.mak \
&& cp GccUnixR/uasm /usr/local/bin/ \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/UASM
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/UASM"
ENV WINDOWS_TOOLCHAIN=/opt/llvm-mingw
RUN echo "====== BUILD LLVM-MINGW ======" \
&& git -C ${HOME} clone --single-branch --depth=1 -b 'system-clang' https://github.com/nolange/llvm-mingw.git \
&& cd ${HOME}/llvm-mingw \
&& export LLVM_VERSION=release/${LLVM_MAJOR}.x \
&& git -C "${HOME}" clone --single-branch --depth=1 -b 'system-clang' https://github.com/nolange/llvm-mingw.git \
&& cd "${HOME}/llvm-mingw" \
&& export LLVM_VERSION="release/${LLVM_MAJOR}.x" \
&& export TOOLCHAIN_ARCHS="$(uname -m)" \
&& if [ "$(uname -m)" = "x86_64" ]; then export TOOLCHAIN_ARCHS="${TOOLCHAIN_ARCHS} i686"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then sed -i 's~continue~~g' build-compiler-rt.sh; fi \
&& ./build-all.sh ${WINDOWS_TOOLCHAIN} --host-clang --with-default-msvcrt=ucrt --enable-cfguard \
&& export PATH=${WINDOWS_TOOLCHAIN}/bin:$PATH \
&& cp -nrvs ${WINDOWS_TOOLCHAIN}/$(uname -m)-w64-mingw32/bin/*.dll ${WINDOWS_SYSROOT}/windows/system32/ \
&& ln -s ${WINDOWS_TOOLCHAIN}/$(uname -m)-w64-mingw32 ${WINDOWS_SYSROOT}/$(uname -m)-w64-mingw32 \
&& if [ "$(uname -m)" = "x86_64" ]; then cp -nrvs ${WINDOWS_TOOLCHAIN}/i686-w64-mingw32/bin/*.dll ${WINDOWS_SYSROOT}/windows/syswow64/ \
&& ln -s ${WINDOWS_TOOLCHAIN}/i686-w64-mingw32 ${WINDOWS_SYSROOT}/i686-w64-mingw32; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/llvm-mingw
&& ./build-all.sh "${WINDOWS_TOOLCHAIN}" --host-clang --with-default-msvcrt=ucrt --enable-cfguard \
&& export PATH="${WINDOWS_TOOLCHAIN}/bin:$PATH" \
&& cp -nrvs ${WINDOWS_TOOLCHAIN}/$(uname -m)-w64-mingw32/bin/*.dll "${WINDOWS_SYSROOT}/windows/system32/" \
&& ln -s "${WINDOWS_TOOLCHAIN}/$(uname -m)-w64-mingw32" "${WINDOWS_SYSROOT}/$(uname -m)-w64-mingw32" \
&& if [ "$(uname -m)" = "x86_64" ]; then cp -nrvs ${WINDOWS_TOOLCHAIN}/i686-w64-mingw32/bin/*.dll "${WINDOWS_SYSROOT}/windows/syswow64/" \
&& ln -s "${WINDOWS_TOOLCHAIN}/i686-w64-mingw32" "${WINDOWS_SYSROOT}/i686-w64-mingw32"; fi \
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/llvm-mingw"
ARG DEBIAN_FRONTEND=noninteractive
RUN echo "====== INSTALL MINGW-W64 ======" \
&& if [ "$(uname -m)" = "x86_64" ]; then apt-get -o Dpkg::Options::="--force-confnew" install -y --no-install-recommends mingw-w64 mingw-w64-tools \
&& apt-get autoremove -y && apt-get clean \
&& cp -nrvs /usr/x86_64-w64-mingw32/lib/*.dll /usr/lib/gcc/x86_64-w64-mingw32/12-posix/*.dll ${WINDOWS_SYSROOT}/windows/system32/ \
&& cp -nrvs /usr/i686-w64-mingw32/lib/*.dll /usr/lib/gcc/i686-w64-mingw32/12-posix/*.dll ${WINDOWS_SYSROOT}/windows/syswow64/ \
&& cp -nrvs /usr/x86_64-w64-mingw32/lib/*.dll /usr/lib/gcc/x86_64-w64-mingw32/12-posix/*.dll "${WINDOWS_SYSROOT}/windows/system32/" \
&& cp -nrvs /usr/i686-w64-mingw32/lib/*.dll /usr/lib/gcc/i686-w64-mingw32/12-posix/*.dll "${WINDOWS_SYSROOT}/windows/syswow64/" \
&& rm -rf /tmp/* /var/tmp/*; fi \
&& if [ "$(uname -m)" = "i686" ]; then apt-get -o Dpkg::Options::="--force-confnew" install -y --no-install-recommends mingw-w64 mingw-w64-tools \
&& apt-get autoremove -y && apt-get clean \
&& cp -nrvs /usr/i686-w64-mingw32/lib/*.dll /usr/lib/gcc/i686-w64-mingw32/12-posix/*.dll ${WINDOWS_SYSROOT}/windows/system32/ \
&& cp -nrvs /usr/i686-w64-mingw32/lib/*.dll /usr/lib/gcc/i686-w64-mingw32/12-posix/*.dll "${WINDOWS_SYSROOT}/windows/system32/" \
&& rm -rf /tmp/* /var/tmp/*; fi
COPY override /
RUN echo "====== TEST TOOLCHAINS ======" \
&& . /opt/wine/winearch \
&& git -C ${HOME} clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
&& if [ ! "$(uname -m)" = "aarch64" ]; then mkdir /tmp/build-$(uname -m)-gnu && cd /tmp/build-$(uname -m)-gnu \
&& nxbuild-windows-$(uname -m)-gnu -GNinja ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe; fi \
&& git -C "${HOME}" clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
&& if [ ! "$(uname -m)" = "aarch64" ]; then mkdir "/tmp/build-$(uname -m)-gnu" && cd "/tmp/build-$(uname -m)-gnu" \
&& "nxbuild-windows-$(uname -m)-gnu" -GNinja "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe; fi \
&& if [ "$(uname -m)" = "x86_64" ]; then mkdir /tmp/build-i686-gnu && cd /tmp/build-i686-gnu \
&& nxbuild-windows-i686-gnu -GNinja ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe; fi \
&& mkdir /tmp/build-$(uname -m)-llvm && cd /tmp/build-$(uname -m)-llvm \
&& nxbuild-windows-$(uname -m)-llvm -GNinja ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe \
&& nxbuild-windows-i686-gnu -GNinja "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe; fi \
&& mkdir "/tmp/build-$(uname -m)-llvm" && cd "/tmp/build-$(uname -m)-llvm" \
&& "nxbuild-windows-$(uname -m)-llvm" -GNinja "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe \
&& if [ "$(uname -m)" = "x86_64" ]; then mkdir /tmp/build-i686-llvm && cd /tmp/build-i686-llvm \
&& nxbuild-windows-i686-llvm -GNinja ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
&& nxbuild-windows-i686-llvm -GNinja "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe; fi \
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"
FROM winebox
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
@ -101,54 +101,54 @@ ENV WindowsSdkDir="${WINEPREFIX}/drive_c/Program Files (x86)/Windows Kits/10" \
VCINSTALLDIR="${WINEPREFIX}/drive_c/Program Files/Microsoft Visual Studio/2022/Community/VC"
RUN echo "====== INSTALL MSVC-WINE ======" \
&& git -C ${HOME} clone --single-branch --depth=1 https://github.com/mstorsjo/msvc-wine.git \
&& git -C "${HOME}" clone --single-branch --depth=1 https://github.com/mstorsjo/msvc-wine.git \
&& mkdir /tmp/msvc-staging /tmp/msvc-cache \
&& echo "Microsoft.VisualStudio.Workload.NativeDesktop" >>${WINEPREFIX}/drive_c/packages-input-pass1.txt \
&& echo "Microsoft.VisualStudio.Workload.Universal" >>${WINEPREFIX}/drive_c/packages-input-pass1.txt \
&& cat ${WINEPREFIX}/drive_c/packages-input-pass1.txt \
| xargs python3 ${HOME}/msvc-wine/vsdownload.py --accept-license --major 17 --sdk-version 20348 --include-optional --print-selection > ${WINEPREFIX}/drive_c/packages-output-pass1.txt \
&& cat ${WINEPREFIX}/drive_c/packages-input-pass1.txt \
| xargs -I{} sed -i "s~^{} ~FILTERED ~g" ${WINEPREFIX}/drive_c/packages-output-pass1.txt \
&& if [ "$(uname -m)" = "x86_64" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass1.txt \
&& echo "Microsoft.VisualStudio.Workload.NativeDesktop" >>"${WINEPREFIX}/drive_c/packages-input-pass1.txt" \
&& echo "Microsoft.VisualStudio.Workload.Universal" >>"${WINEPREFIX}/drive_c/packages-input-pass1.txt" \
&& cat "${WINEPREFIX}/drive_c/packages-input-pass1.txt" \
| xargs python3 "${HOME}/msvc-wine/vsdownload.py" --accept-license --major 17 --sdk-version 20348 --include-optional --print-selection >"${WINEPREFIX}/drive_c/packages-output-pass1.txt" \
&& cat "${WINEPREFIX}/drive_c/packages-input-pass1.txt" \
| xargs -I{} sed -i "s~^{} ~FILTERED ~g" "${WINEPREFIX}/drive_c/packages-output-pass1.txt" \
&& if [ "$(uname -m)" = "x86_64" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass1.txt" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|Host[Xx]86|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass1.txt; fi \
&& if [ "$(uname -m)" = "i686" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass1.txt \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|Host[Xx]86|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass1.txt"; fi \
&& if [ "$(uname -m)" = "i686" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass1.txt"" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|[Xx]64[. ]|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass1.txt; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass1.txt \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|[Xx]64[. ]|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass1.txt"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass1.txt" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Xx]86[. ]|[Xx]64[. ]|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass1.txt; fi \
&& cat ${WINEPREFIX}/drive_c/packages-selected-pass1.txt \
| grep ' 0 bytes' | awk '{print $1}' | sort -u > ${WINEPREFIX}/drive_c/packages-input-pass2.txt \
&& cat ${WINEPREFIX}/drive_c/packages-input-pass2.txt \
| xargs python3 ${HOME}/msvc-wine/vsdownload.py --accept-license --major 17 --include-optional --print-selection > ${WINEPREFIX}/drive_c/packages-output-pass2.txt \
&& cat ${WINEPREFIX}/drive_c/packages-input-pass2.txt \
| xargs -I{} sed -i "s~^{} ~FILTERED ~g" ${WINEPREFIX}/drive_c/packages-output-pass2.txt \
&& if [ "$(uname -m)" = "x86_64" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass2.txt \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Xx]86[. ]|[Xx]64[. ]|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass1.txt"; fi \
&& cat "${WINEPREFIX}/drive_c/packages-selected-pass1.txt" \
| grep ' 0 bytes' | awk '{print $1}' | sort -u >"${WINEPREFIX}/drive_c/packages-input-pass2.txt" \
&& cat "${WINEPREFIX}/drive_c/packages-input-pass2.txt" \
| xargs python3 "${HOME}/msvc-wine/vsdownload.py" --accept-license --major 17 --include-optional --print-selection >"${WINEPREFIX}/drive_c/packages-output-pass2.txt" \
&& cat "${WINEPREFIX}/drive_c/packages-input-pass2.txt" \
| xargs -I{} sed -i "s~^{} ~FILTERED ~g" "${WINEPREFIX}/drive_c/packages-output-pass2.txt" \
&& if [ "$(uname -m)" = "x86_64" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass2.txt" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|Host[Xx]86|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass2.txt; fi \
&& if [ "$(uname -m)" = "i686" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass2.txt \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|Host[Xx]86|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass2.txt"; fi \
&& if [ "$(uname -m)" = "i686" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass2.txt" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|[Xx]64[. ]|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass2.txt; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cat ${WINEPREFIX}/drive_c/packages-output-pass2.txt \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Aa][Rr][Mm]64[Ee. ]|[Xx]64[. ]|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass2.txt"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cat "${WINEPREFIX}/drive_c/packages-output-pass2.txt" \
| egrep '^Microsoft.|^Win..SDK' \
| egrep '^Microsoft\.Windows|\.VC\.|\.VisualC\.|\.VisualCpp\.|\.20348' \
| egrep -v '\.ATL[. ]|\.CA\.|\.CodeAnalysis|\.CoreIDE|\.IFC[. ]|\.MFC[. ]|\.Modules|\.MSBuild|\.Premium|\.Prem[. ]|\.Props[. ]|\.Resources|\.Res[. ]|\.Servicing|\.Shortcuts|\.Templates|\.TestAdapter|\.VisualStudio\.VC.[^L][^l]' \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Xx]86[. ]|[Xx]64[. ]|\(Ms[iu]\)' > ${WINEPREFIX}/drive_c/packages-selected-pass2.txt; fi \
&& cat ${WINEPREFIX}/drive_c/packages-selected-pass2.txt \
| grep -v ' 0 bytes' | awk '{print $1}' | sort -u > ${WINEPREFIX}/drive_c/packages-finalized.txt \
&& cat ${WINEPREFIX}/drive_c/packages-finalized.txt \
| xargs python3 ${HOME}/msvc-wine/vsdownload.py --accept-license --major 17 --cache /tmp/msvc-cache --dest /tmp/msvc-staging \
| egrep -v '14\.[12].\.|[Aa][Rr][Mm][. ]|[Xx]86[. ]|[Xx]64[. ]|\(Ms[iu]\)' >"${WINEPREFIX}/drive_c/packages-selected-pass2.txt"; fi \
&& cat "${WINEPREFIX}/drive_c/packages-selected-pass2.txt" \
| grep -v ' 0 bytes' | awk '{print $1}' | sort -u >"${WINEPREFIX}/drive_c/packages-finalized.txt" \
&& cat "${WINEPREFIX}/drive_c/packages-finalized.txt" \
| xargs python3 "${HOME}/msvc-wine/vsdownload.py" --accept-license --major 17 --cache /tmp/msvc-cache --dest /tmp/msvc-staging \
&& mkdir -p "${WindowsSdkDir}" \
&& mv /tmp/msvc-staging/kits/10/* "${WindowsSdkDir}/" \
&& rm -rf \
@ -177,10 +177,10 @@ RUN echo "====== INSTALL MSVC-WINE ======" \
&& if [ ! "$(uname -m)" = "aarch64" ]; then find "${VSINSTALLDIR}" -name 'arm64' -type d -exec rm -rf {} +; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then find "${VSINSTALLDIR}" -name 'x86' -type d -exec rm -rf {} +; fi \
&& mkdir /usr/lib/clang/${LLVM_MAJOR}/lib/windows \
&& if [ "$(uname -m)" = "x86_64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/x64/lib/clang/${LLVM_MAJOR}/lib/windows/." /usr/lib/clang/${LLVM_MAJOR}/lib/windows/; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/ARM64/lib/clang/${LLVM_MAJOR}/lib/windows/." /usr/lib/clang/${LLVM_MAJOR}/lib/windows/; fi \
&& if [ ! "$(uname -m)" = "aarch64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/lib/clang/${LLVM_MAJOR}/lib/windows/." /usr/lib/clang/${LLVM_MAJOR}/lib/windows/; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* "${VCINSTALLDIR}/Tools/Llvm" ${HOME}/msvc-wine
&& if [ "$(uname -m)" = "x86_64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/x64/lib/clang/${LLVM_MAJOR}/lib/windows/." "/usr/lib/clang/${LLVM_MAJOR}/lib/windows/"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/ARM64/lib/clang/${LLVM_MAJOR}/lib/windows/." "/usr/lib/clang/${LLVM_MAJOR}/lib/windows/"; fi \
&& if [ ! "$(uname -m)" = "aarch64" ]; then cp -nrv "${VCINSTALLDIR}/Tools/Llvm/lib/clang/${LLVM_MAJOR}/lib/windows/." "/usr/lib/clang/${LLVM_MAJOR}/lib/windows/"; fi \
&& rm -rf /tmp/* /var/tmp/* "${VCINSTALLDIR}/Tools/Llvm" "${HOME}/msvc-wine"
ENV WindowsSDKVersion=10.0.20348.0 \
VCToolsVersion=14.39.33519 \
@ -197,32 +197,32 @@ RUN echo "====== SANITY CHECK ======" \
&& echo "== WinSDK Contains: " && ls "${WindowsSdkBinPath}" \
&& echo "== Redist Contains: " && ls "${VCToolsRedistDir}" \
&& echo "== Tools Contains: " && ls "${VCToolsInstallDir}" \
&& if [ "$(uname -m)" = "x86_64" ]; then find "${WindowsSDKRedist}/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${WindowsSdkBinPath}/x64/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/debug_nonredist/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/; fi \
&& if [ "$(uname -m)" = "x86_64" ]; then find "${WindowsSDKRedist}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/syswow64/ \
&& find "${WindowsSdkBinPath}/x86/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/syswow64/ \
&& find "${VCToolsRedistDir}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/syswow64/ \
&& find "${VCToolsRedistDir}/debug_nonredist/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/syswow64/; fi \
&& if [ "$(uname -m)" = "i686" ]; then find "${WindowsSDKRedist}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${WindowsSdkBinPath}/x86/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/debug_nonredist/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then find "${WindowsSDKRedist}/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${WindowsSdkBinPath}/arm64/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/ \
&& find "${VCToolsRedistDir}/debug_nonredist/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} ${WINDOWS_SYSROOT}/windows/system32/; fi
&& if [ "$(uname -m)" = "x86_64" ]; then find "${WindowsSDKRedist}/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${WindowsSdkBinPath}/x64/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/debug_nonredist/x64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/"; fi \
&& if [ "$(uname -m)" = "x86_64" ]; then find "${WindowsSDKRedist}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/syswow64/" \
&& find "${WindowsSdkBinPath}/x86/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/syswow64/" \
&& find "${VCToolsRedistDir}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/syswow64/" \
&& find "${VCToolsRedistDir}/debug_nonredist/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/syswow64/"; fi \
&& if [ "$(uname -m)" = "i686" ]; then find "${WindowsSDKRedist}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${WindowsSdkBinPath}/x86/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/debug_nonredist/x86" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/"; fi \
&& if [ "$(uname -m)" = "aarch64" ]; then find "${WindowsSDKRedist}/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${WindowsSdkBinPath}/arm64/ucrt" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/" \
&& find "${VCToolsRedistDir}/debug_nonredist/arm64" -name '*.dll' -type f | xargs -I{} cp -nvs {} "${WINDOWS_SYSROOT}/windows/system32/"; fi
COPY override /
RUN echo "====== TEST TOOLCHAINS ======" \
&& . /opt/wine/winearch \
&& git -C ${HOME} clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
&& mkdir /tmp/build-$(uname -m) && cd /tmp/build-$(uname -m) \
&& if [ "$(uname -m)" = "aarch64" ]; then sed -i 's~PRIVATE HelloWorld)~PRIVATE HelloWorld_Static)~g' ${HOME}/hello-test/CMakeLists.txt; fi \
&& nxbuild-windows-$(uname -m)-msvc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe \
&& git -C "${HOME}" clone --single-branch --depth=1 https://code.nephatrine.net/nephatrine/hello-test.git \
&& mkdir "/tmp/build-$(uname -m)" && cd "/tmp/build-$(uname -m)" \
&& if [ "$(uname -m)" = "aarch64" ]; then sed -i 's~PRIVATE HelloWorld)~PRIVATE HelloWorld_Static)~g' "${HOME}/hello-test/CMakeLists.txt"; fi \
&& "nxbuild-windows-$(uname -m)-msvc" -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe \
&& if [ "$(uname -m)" = "x86_64" ]; then mkdir /tmp/build-i686 && cd /tmp/build-i686 \
&& nxbuild-windows-i686-msvc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo ${HOME}/hello-test \
&& ninja && ${WINE} ./HelloTest.exe; fi \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
&& nxbuild-windows-i686-msvc -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo "${HOME}/hello-test" \
&& ninja && "${WINE}" ./HelloTest.exe; fi \
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"

View File

@ -5,7 +5,7 @@ SPDX-License-Identifier: ISC
-->
[Git](https://code.nephatrine.net/NephNET/builder-cross-windows/src/branch/master) |
[Docker](https://hub.docker.com/r/nephatrine/nxbuilder/)
[Docker](https://hub.docker.com/r/nephatrine/nxb-cross-windows/)
# NXBuilder
@ -21,6 +21,7 @@ beyond that. It can also be used as a quick "cleanroom" to test builds in.
- [Clang](https://clang.llvm.org/)
- [GCC](https://gcc.gnu.org/)
- [Go](https://go.dev/)
### Cross-Compilers
@ -40,5 +41,5 @@ beyond that. It can also be used as a quick "cleanroom" to test builds in.
You can spin up a quick temporary test container like this:
~~~
docker run --rm -ti nephatrine/nxbuilder:cross-windows /bin/bash
docker run --rm -ti nephatrine/nxb-cross-windows:latest /bin/bash
~~~