mirror of
https://github.com/hectorm/docker-qemu-reactos
synced 2025-01-09 02:27:13 +00:00
Build common stages separately
This commit is contained in:
parent
d3bb0c7b75
commit
2f8f43e6f7
46
.github/workflows/main.yml
vendored
46
.github/workflows/main.yml
vendored
@ -12,9 +12,34 @@ permissions: {}
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
||||||
|
build-common-stages:
|
||||||
|
name: 'Build common stages'
|
||||||
|
runs-on: 'ubuntu-22.04'
|
||||||
|
permissions:
|
||||||
|
contents: 'read'
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
stage: ['build']
|
||||||
|
steps:
|
||||||
|
- name: 'Checkout project'
|
||||||
|
uses: 'actions/checkout@v3'
|
||||||
|
- name: 'Build and save image'
|
||||||
|
run: |
|
||||||
|
make \
|
||||||
|
IMAGE_REGISTRY="localhost" IMAGE_NAMESPACE="stage" IMAGE_PROJECT="${{ matrix.stage }}" \
|
||||||
|
IMAGE_BUILD_OPTS="--pull --target ${{ matrix.stage }} --build-arg BUILDKIT_INLINE_CACHE=1" \
|
||||||
|
build-native-image save-native-image
|
||||||
|
- name: 'Upload artifacts'
|
||||||
|
uses: 'actions/upload-artifact@v3'
|
||||||
|
with:
|
||||||
|
name: 'dist-common-stages'
|
||||||
|
path: './dist/'
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
build:
|
build:
|
||||||
name: 'Build ${{ matrix.arch }} image'
|
name: 'Build ${{ matrix.arch }} image'
|
||||||
runs-on: 'ubuntu-latest'
|
needs: ['build-common-stages']
|
||||||
|
runs-on: 'ubuntu-22.04'
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'read'
|
contents: 'read'
|
||||||
strategy:
|
strategy:
|
||||||
@ -23,13 +48,24 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 'Checkout project'
|
- name: 'Checkout project'
|
||||||
uses: 'actions/checkout@v3'
|
uses: 'actions/checkout@v3'
|
||||||
|
- name: 'Download artifacts'
|
||||||
|
uses: 'actions/download-artifact@v3'
|
||||||
|
with:
|
||||||
|
name: 'dist-common-stages'
|
||||||
|
path: './dist/'
|
||||||
|
- name: 'Load common stages'
|
||||||
|
run: |
|
||||||
|
docker system prune --all --force
|
||||||
|
make IMAGE_REGISTRY="localhost" IMAGE_NAMESPACE="stage" IMAGE_PROJECT="build" load-native-image clean
|
||||||
- name: 'Register binfmt entries'
|
- name: 'Register binfmt entries'
|
||||||
if: "matrix.arch != 'native'"
|
if: "matrix.arch != 'native'"
|
||||||
run: |
|
run: |
|
||||||
make binfmt-register
|
make binfmt-register
|
||||||
- name: 'Build and save image'
|
- name: 'Build and save image'
|
||||||
run: |
|
run: |
|
||||||
make IMAGE_BUILD_OPTS="--pull" "build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image"
|
make \
|
||||||
|
IMAGE_BUILD_OPTS="--cache-from localhost/stage/build:latest" \
|
||||||
|
"build-${{ matrix.arch }}-image" "save-${{ matrix.arch }}-image"
|
||||||
- name: 'Upload artifacts'
|
- name: 'Upload artifacts'
|
||||||
if: "startsWith(github.ref, 'refs/tags/v') && matrix.arch != 'native'"
|
if: "startsWith(github.ref, 'refs/tags/v') && matrix.arch != 'native'"
|
||||||
uses: 'actions/upload-artifact@v3'
|
uses: 'actions/upload-artifact@v3'
|
||||||
@ -42,7 +78,7 @@ jobs:
|
|||||||
name: 'Push ${{ matrix.arch }} image'
|
name: 'Push ${{ matrix.arch }} image'
|
||||||
if: "startsWith(github.ref, 'refs/tags/v')"
|
if: "startsWith(github.ref, 'refs/tags/v')"
|
||||||
needs: ['build']
|
needs: ['build']
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-22.04'
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'read'
|
contents: 'read'
|
||||||
strategy:
|
strategy:
|
||||||
@ -70,7 +106,7 @@ jobs:
|
|||||||
name: 'Push manifest'
|
name: 'Push manifest'
|
||||||
if: "startsWith(github.ref, 'refs/tags/v')"
|
if: "startsWith(github.ref, 'refs/tags/v')"
|
||||||
needs: ['push']
|
needs: ['push']
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-22.04'
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'read'
|
contents: 'read'
|
||||||
steps:
|
steps:
|
||||||
@ -90,7 +126,7 @@ jobs:
|
|||||||
name: 'Create GitHub release'
|
name: 'Create GitHub release'
|
||||||
if: "startsWith(github.ref, 'refs/tags/v')"
|
if: "startsWith(github.ref, 'refs/tags/v')"
|
||||||
needs: ['push-manifest']
|
needs: ['push-manifest']
|
||||||
runs-on: 'ubuntu-latest'
|
runs-on: 'ubuntu-22.04'
|
||||||
permissions:
|
permissions:
|
||||||
contents: 'write'
|
contents: 'write'
|
||||||
steps:
|
steps:
|
||||||
|
Loading…
Reference in New Issue
Block a user