refactor: rewrite ci workflows

This commit is contained in:
Daniel Wolf 2024-03-27 13:06:31 -04:00
parent 00877afa67
commit 95bb2cca8e
Signed by: nephatrine
GPG Key ID: 59D70EC2E4AAB4D0
4 changed files with 335 additions and 159 deletions

View File

@ -9,9 +9,10 @@ on:
schedule:
- cron: '0 20 * * 3'
jobs:
build_amd64:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
build_legacy_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: Checkout Repository
uses: https://gitea.com/actions/checkout@v4
@ -24,84 +25,11 @@ jobs:
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
tags: code.nephatrine.net/nephnet/nxb-cross-darwin:latest-amd64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:latest-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:latest-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-darwin:${BRANCH}-latest-amd64 --platform linux/amd64 ${{ 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_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
- name: Docker Login (Pull Auth)
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
tags: code.nephatrine.net/nephnet/nxb-cross-darwin:latest-arm64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:latest-arm64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:latest-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-darwin:${BRANCH}-latest-arm64 --platform linux/arm64/v8 ${{ 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 }}
legacy_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 }}
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 == ''
@ -112,9 +40,9 @@ jobs:
pull: true
push: true
file: Dockerfile.legacy
tags: code.nephatrine.net/nephnet/nxb-cross-darwin:legacy-amd64
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:legacy-amd64
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:legacy-amd64,mode=max
tags: code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy-cache,mode=max
- name: Build & Push (Branch)
if: gitea.ref_name != 'master' && gitea.ref_name != ''
run: |
@ -125,11 +53,30 @@ jobs:
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure() || gitea.event_name != 'schedule'
with:
title: "Container Build (X86_64; LEGACY)"
title: "Container Build (X86_64; 10.13)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
legacy_i386:
if: gitea.repository_owner == 'NephNET' && (!contains(gitea.event.head_commit.message, '#noci') || gitea.event_name == 'schedule')
push_legacy_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_legacy_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-darwin-amd64:legacy --platform linux/amd64
docker tag code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy nephatrine/amd64:nxb-cross-darwin-legacy
docker rmi code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy
docker push nephatrine/amd64:nxb-cross-darwin-legacy
docker rmi nephatrine/amd64:nxb-cross-darwin-legacy
build_legacy_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
@ -142,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 == ''
@ -152,76 +104,299 @@ jobs:
pull: true
push: true
file: Dockerfile.legacy
tags: code.nephatrine.net/nephnet/nxb-cross-darwin:legacy-i386
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:legacy-i386
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-cache:legacy-i386,mode=max
tags: code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy-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-darwin:${BRANCH}-legacy-i386 --platform linux/386 -f Dockerfile.legacy ${{ gitea.workspace }}
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Build (I686; 10.13)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_legacy_i386:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_legacy_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-darwin-i386:legacy --platform linux/386
docker tag code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy nephatrine/ia32:nxb-cross-darwin-legacy
docker rmi code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy
docker push nephatrine/ia32:nxb-cross-darwin-legacy
docker rmi nephatrine/ia32:nxb-cross-darwin-legacy
build_latest_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: 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/amd64
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest-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-darwin:${BRANCH}-latest-amd64 --platform linux/amd64 -f Dockerfile ${{ 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; LEGACY)"
title: "Container Build (X86_64; 13.3)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
legacy_manifest:
push_latest_amd64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [legacy_amd64, legacy_i386]
needs: [build_latest_amd64]
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-darwin:legacy -t nephatrine/nxbuilder:cross-darwin-17 code.nephatrine.net/nephnet/nxb-cross-darwin:legacy-amd64 code.nephatrine.net/nephnet/nxb-cross-darwin:legacy-i386
build_manifest:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_amd64, build_arm64]
runs-on: nephnet-amd64
- name: Tag & Push
run: |
docker pull code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest --platform linux/amd64
docker tag code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest nephatrine/amd64:nxb-cross-darwin-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest
docker push nephatrine/amd64:nxb-cross-darwin-latest
docker rmi nephatrine/amd64:nxb-cross-darwin-latest
build_latest_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: Check Base Image
if: gitea.event_name == 'schedule'
uses: https://github.com/lucacome/docker-image-update-checker@v1
id: checkbase
with:
base-image: nephatrine/nxbuilder:llvm16-stable
image: nephatrine/nxbuilder:cross-darwin-22.4
platforms: linux/amd64
- 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
- name: Docker Login (Pull Auth)
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-darwin:latest -t nephatrine/nxbuilder:cross-darwin-22.4 -t nephatrine/nxbuilder:cross-darwin-22 -t nephatrine/nxbuilder:cross-darwin code.nephatrine.net/nephnet/nxb-cross-darwin:latest-amd64 code.nephatrine.net/nephnet/nxb-cross-darwin:latest-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: Build & Push (Master)
uses: https://github.com/docker/build-push-action@v5
if: gitea.ref_name == 'master' || gitea.ref_name == ''
with:
title: "DockerHub: nxb-cross-darwin"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxbuilder/general).\nPull `nephatrine/nxbuilder:cross-darwin-22.4` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
context: .
platforms: linux/arm64/v8
provenance: false
pull: true
push: true
file: Dockerfile
tags: code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest
cache-from: type=registry,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest-cache
cache-to: type=registry,image-manifest=true,oci-mediatypes=true,ref=code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest-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-darwin:${BRANCH}-latest-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 Publish"
title: "Container Build (AARCH64; 13.3)"
webhook: ${{ secrets.DISCORD_WEBHOOK_BUILD }}
push_latest_arm64:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_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-darwin-arm64:latest --platform linux/arm64/v8
docker tag code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest nephatrine/arm64:nxb-cross-darwin-latest
docker rmi code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest
docker push nephatrine/arm64:nxb-cross-darwin-latest
docker rmi nephatrine/arm64:nxb-cross-darwin-latest
build_legacy:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_legacy_amd64, build_legacy_i386]
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-darwin:10.13 --amend code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:legacy --amend code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-darwin:10.13
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (10.13)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
push_legacy:
needs: [push_legacy_amd64, push_legacy_i386]
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/nxb-cross-darwin:10.13 --amend nephatrine/amd64:nxb-cross-darwin-legacy --amend nephatrine/ia32:nxb-cross-darwin-legacy --amend nephatrine/arm64:nxb-cross-darwin-legacy --amend nephatrine/armv7:nxb-cross-darwin-legacy
docker manifest push --purge nephatrine/nxb-cross-darwin:10.13
- name: Notify Discord
if: gitea.event_name != 'schedule'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: nxb-cross-darwin (10.13)"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxb-cross-darwin/general).\nPull `nephatrine/nxb-cross-darwin:10.13` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
build_latest:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_amd64, build_latest_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-darwin:latest --amend code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest --amend code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest
docker manifest create code.nephatrine.net/nephnet/nxb-cross-darwin:13.3 --amend code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest --amend code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-darwin:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-darwin:13.3
- name: Notify Discord
uses: https://github.com/sarisia/actions-status-discord@v1
if: failure()
with:
title: "Container Publish (13.3)"
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
push_latest:
needs: [push_latest_amd64, push_latest_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/nxb-cross-darwin:latest --amend nephatrine/amd64:nxb-cross-darwin-latest --amend nephatrine/ia32:nxb-cross-darwin-latest --amend nephatrine/arm64:nxb-cross-darwin-latest --amend nephatrine/armv7:nxb-cross-darwin-latest
docker manifest create nephatrine/nxb-cross-darwin:13.3 --amend nephatrine/amd64:nxb-cross-darwin-latest --amend nephatrine/ia32:nxb-cross-darwin-latest --amend nephatrine/arm64:nxb-cross-darwin-latest --amend nephatrine/armv7:nxb-cross-darwin-latest
docker manifest push --purge nephatrine/nxb-cross-darwin:latest
docker manifest push --purge nephatrine/nxb-cross-darwin:13.3
- name: Notify Discord
if: gitea.event_name != 'schedule'
uses: https://github.com/sarisia/actions-status-discord@v1
with:
title: "DockerHub: nxb-cross-darwin (13.3)"
description: "The container image was pushed to [DockerHub](https://hub.docker.com/repository/docker/nephatrine/nxb-cross-darwin/general).\nPull `nephatrine/nxb-cross-darwin:13.3` for the newest image."
nodetail: true
webhook: ${{ secrets.DISCORD_WEBHOOK_PACKAGE }}
build_combination:
if: gitea.ref_name == 'master' || gitea.ref_name == ''
needs: [build_latest_amd64, build_legacy_i386, build_latest_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-darwin:internal --amend code.nephatrine.net/nephnet/nxb-cross-darwin-amd64:latest --amend code.nephatrine.net/nephnet/nxb-cross-darwin-i386:legacy --amend code.nephatrine.net/nephnet/nxb-cross-darwin-arm64:latest
docker manifest push --purge code.nephatrine.net/nephnet/nxb-cross-darwin:internal
build_combination:
needs: [push_latest_amd64, push_legacy_i386, push_latest_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-osxcross --amend nephatrine/amd64:nxb-cross-darwin-latest --amend nephatrine/ia32:nxb-cross-darwin-legacy --amend nephatrine/arm64:nxb-cross-darwin-latest
docker manifest push --purge nephatrine/nxbuilder:debian-osxcross
update_readme:
needs: [push_legacy, push_latest]
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-darwin

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: ISC
FROM code.nephatrine.net/nephnet/nxb-debian:llvm16-stable
FROM code.nephatrine.net/nephnet/nxb-debian:latest-llvm
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
ARG OSX_MIN_VERSION=10.15
@ -12,23 +12,23 @@ ENV DARWIN_SDK=${OSX_USE_VERSION} DARWIN_TOOLCHAIN=/opt/osxcross
ENV DARWIN_SYSROOT=${DARWIN_TOOLCHAIN}/SDK/MacOSX${DARWIN_SDK}.sdk
RUN echo "====== INSTALL OSXCROSS ======" \
&& git -C ${HOME} clone --single-branch --depth=1 https://github.com/nephatrine/osxcross.git && cd ${HOME}/osxcross \
&& wget -O tarballs/MacOSX${DARWIN_SDK}.sdk.tar.xz https://nephatrine.net/osxsdk/MacOSX${DARWIN_SDK}.sdk.tar.xz \
&& git -C "${HOME}" clone --single-branch --depth=1 https://github.com/nephatrine/osxcross.git && cd "${HOME}/osxcross" \
&& wget --progress=dot:giga -O "tarballs/MacOSX${DARWIN_SDK}.sdk.tar.xz" "https://nephatrine.net/osxsdk/MacOSX${DARWIN_SDK}.sdk.tar.xz" \
&& sed -i "s~BRANCH=main~BRANCH=release/${LLVM_MAJOR}.x~g" ./build_compiler_rt.sh \
&& SDK_VERSION=${DARWIN_SDK} SDK_DIR=${DARWIN_SYSROOT} TARGET_DIR=${DARWIN_TOOLCHAIN} UNATTENDED=1 ./build.sh \
&& PATH=${DARWIN_TOOLCHAIN}/bin:$PATH ./build_compiler_rt.sh \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.a /usr/lib/clang/${LLVM_MAJOR}/lib/darwin/ \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.dylib /usr/lib/clang/${LLVM_MAJOR}/lib/darwin/ \
&& cp -nrv ./build/compiler-rt/compiler-rt/include/. /usr/lib/clang/${LLVM_MAJOR}/include/ \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/osxcross
&& SDK_VERSION="${DARWIN_SDK}" SDK_DIR="${DARWIN_SYSROOT}" TARGET_DIR="${DARWIN_TOOLCHAIN}" UNATTENDED=1 ./build.sh \
&& PATH="${DARWIN_TOOLCHAIN}/bin:$PATH" ./build_compiler_rt.sh \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.a "/usr/lib/clang/${LLVM_MAJOR}/lib/darwin/" \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.dylib "/usr/lib/clang/${LLVM_MAJOR}/lib/darwin/" \
&& cp -nrv ./build/compiler-rt/compiler-rt/include/. "/usr/lib/clang/${LLVM_MAJOR}/include/" \
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/osxcross"
ENV PATH=${DARWIN_TOOLCHAIN}/bin:$PATH
ENV MACOSX_DEPLOYMENT_TARGET=${DARWIN_SDK} OSXCROSS_MP_INC=1
RUN echo "====== CONFIGURE MACPORTS ======" \
&& mkdir -p ${DARWIN_TOOLCHAIN}/macports/pkgs/opt \
&& ln -s ${DARWIN_TOOLCHAIN}/macports/pkgs/opt ${DARWIN_SYSROOT}/opt \
&& sed -i 's/\bopenssl rmd160\b/openssl rmd160 -provider legacy/g' ${DARWIN_TOOLCHAIN}/bin/osxcross-macports \
&& sed -i 's/\bopenssl dgst -ripemd160 -verify\b/openssl dgst -provider default -provider legacy -ripemd160 -verify/g' ${DARWIN_TOOLCHAIN}/bin/osxcross-macports \
&& mkdir -p "${DARWIN_TOOLCHAIN}/macports/pkgs/opt" \
&& ln -s "${DARWIN_TOOLCHAIN}/macports/pkgs/opt" "${DARWIN_SYSROOT}/opt" \
&& sed -i 's/\bopenssl rmd160\b/openssl rmd160 -provider legacy/g' "${DARWIN_TOOLCHAIN}/bin/osxcross-macports" \
&& sed -i 's/\bopenssl dgst -ripemd160 -verify\b/openssl dgst -provider default -provider legacy -ripemd160 -verify/g' "${DARWIN_TOOLCHAIN}/bin/osxcross-macports" \
&& if [ "$(uname -m)" = "aarch64" ]; then sed -i 's~ARCH="x86_64"~ARCH="arm64"~g' /opt/osxcross/bin/osxcross-macports; fi \
&& if [ "$(uname -m)" = "i686" ]; then sed -i 's~ARCH="x86_64"~ARCH="i386"~g' /opt/osxcross/bin/osxcross-macports; fi \
&& echo 1 | osxcross-macports update-cache \
@ -43,11 +43,11 @@ RUN echo "====== CONFIGURE MACPORTS ======" \
COPY override /
RUN echo "====== TEST TOOLCHAIN ======" \
&& 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) \
&& nxbuild-darwin-$(uname -m) -GNinja ${HOME}/hello-test \
&& 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)" \
&& "nxbuild-darwin-$(uname -m)" -GNinja "${HOME}/hello-test" \
&& ninja && file HelloTest \
&& mkdir /tmp/build-fat && cd /tmp/build-fat \
&& nxbuild-darwin-universal -GNinja ${HOME}/hello-test \
&& nxbuild-darwin-universal -GNinja "${HOME}/hello-test" \
&& ninja && lipo -info HelloTest \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/hello-test"

View File

@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: ISC
FROM code.nephatrine.net/nephnet/nxb-debian:llvm14-stable
FROM code.nephatrine.net/nephnet/nxb-debian:latest-llvm
LABEL maintainer="Daniel Wolf <nephatrine@gmail.com>"
ARG OSX_MIN_VERSION=10.6
@ -12,23 +12,23 @@ ENV DARWIN_SDK=${OSX_USE_VERSION} DARWIN_TOOLCHAIN=/opt/osxcross
ENV DARWIN_SYSROOT=${DARWIN_TOOLCHAIN}/SDK/MacOSX${DARWIN_SDK}.sdk
RUN echo "====== INSTALL OSXCROSS ======" \
&& git -C ${HOME} clone --single-branch --depth=1 https://github.com/nephatrine/osxcross.git && cd ${HOME}/osxcross \
&& wget -O tarballs/MacOSX${DARWIN_SDK}.sdk.tar.xz https://nephatrine.net/osxsdk/MacOSX${DARWIN_SDK}.sdk.tar.xz \
&& git -C "${HOME}" clone --single-branch --depth=1 https://github.com/nephatrine/osxcross.git && cd "${HOME}/osxcross" \
&& wget --progress=dot:giga -O "tarballs/MacOSX${DARWIN_SDK}.sdk.tar.xz" "https://nephatrine.net/osxsdk/MacOSX${DARWIN_SDK}.sdk.tar.xz" \
&& sed -i "s~BRANCH=main~BRANCH=release/${LLVM_MAJOR}.x~g" ./build_compiler_rt.sh \
&& SDK_VERSION=${DARWIN_SDK} SDK_DIR=${DARWIN_SYSROOT} TARGET_DIR=${DARWIN_TOOLCHAIN} UNATTENDED=1 ./build.sh \
&& PATH=${DARWIN_TOOLCHAIN}/bin:$PATH ./build_compiler_rt.sh \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.a /usr/lib/clang/${LLVM_MAJOR}/lib/darwin/ \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.dylib /usr/lib/clang/${LLVM_MAJOR}/lib/darwin/ \
&& cp -nrv ./build/compiler-rt/compiler-rt/include/. /usr/lib/clang/${LLVM_MAJOR}/include/ \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/osxcross
&& SDK_VERSION="${DARWIN_SDK}" SDK_DIR="${DARWIN_SYSROOT}" TARGET_DIR="${DARWIN_TOOLCHAIN}" UNATTENDED=1 ./build.sh \
&& PATH="${DARWIN_TOOLCHAIN}/bin:$PATH" ./build_compiler_rt.sh \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.a "/usr/lib/clang/${LLVM_MAJOR}/lib/darwin/" \
&& cp -nv ./build/compiler-rt/compiler-rt/build/lib/darwin/*.dylib "/usr/lib/clang/${LLVM_MAJOR}/lib/darwin/" \
&& cp -nrv ./build/compiler-rt/compiler-rt/include/. "/usr/lib/clang/${LLVM_MAJOR}/include/" \
&& cd .. && rm -rf /tmp/* /var/tmp/* "${HOME}/osxcross"
ENV PATH=${DARWIN_TOOLCHAIN}/bin:$PATH
ENV MACOSX_DEPLOYMENT_TARGET=${DARWIN_SDK} OSXCROSS_MP_INC=1
RUN echo "====== CONFIGURE MACPORTS ======" \
&& mkdir -p ${DARWIN_TOOLCHAIN}/macports/pkgs/opt \
&& ln -s ${DARWIN_TOOLCHAIN}/macports/pkgs/opt ${DARWIN_SYSROOT}/opt \
&& sed -i 's/\bopenssl rmd160\b/openssl rmd160 -provider legacy/g' ${DARWIN_TOOLCHAIN}/bin/osxcross-macports \
&& sed -i 's/\bopenssl dgst -ripemd160 -verify\b/openssl dgst -provider default -provider legacy -ripemd160 -verify/g' ${DARWIN_TOOLCHAIN}/bin/osxcross-macports \
&& mkdir -p "${DARWIN_TOOLCHAIN}/macports/pkgs/opt" \
&& ln -s "${DARWIN_TOOLCHAIN}/macports/pkgs/opt" "${DARWIN_SYSROOT}/opt" \
&& sed -i 's/\bopenssl rmd160\b/openssl rmd160 -provider legacy/g' "${DARWIN_TOOLCHAIN}/bin/osxcross-macports" \
&& sed -i 's/\bopenssl dgst -ripemd160 -verify\b/openssl dgst -provider default -provider legacy -ripemd160 -verify/g' "${DARWIN_TOOLCHAIN}/bin/osxcross-macports" \
&& if [ "$(uname -m)" = "aarch64" ]; then sed -i 's~ARCH="x86_64"~ARCH="arm64"~g' /opt/osxcross/bin/osxcross-macports; fi \
&& if [ "$(uname -m)" = "i686" ]; then sed -i 's~ARCH="x86_64"~ARCH="i386"~g' /opt/osxcross/bin/osxcross-macports; fi \
&& echo 1 | osxcross-macports update-cache \
@ -44,11 +44,11 @@ RUN echo "====== CONFIGURE MACPORTS ======" \
COPY override /
RUN echo "====== TEST TOOLCHAIN ======" \
&& 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) \
&& nxbuild-darwin-$(uname -m) -GNinja ${HOME}/hello-test \
&& 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)" \
&& "nxbuild-darwin-$(uname -m)" -GNinja "${HOME}/hello-test" \
&& ninja && file HelloTest \
&& mkdir /tmp/build-fat && cd /tmp/build-fat \
&& nxbuild-darwin-universal -GNinja ${HOME}/hello-test \
&& nxbuild-darwin-universal -GNinja "${HOME}/hello-test" \
&& ninja && lipo -info HelloTest \
&& cd /tmp && rm -rf /tmp/* /var/tmp/* ${HOME}/hello-test
&& 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-darwin/src/branch/master) |
[Docker](https://hub.docker.com/r/nephatrine/nxbuilder/)
[Docker](https://hub.docker.com/r/nephatrine/nxb-cross-darwin/)
# 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
@ -38,5 +39,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-darwin-22.4 /bin/bash
docker run --rm -ti nephatrine/nxb-cross-darwin:latest /bin/bash
~~~