mirror of
https://github.com/JasonN3/build-container-installer.git
synced 2025-12-25 02:47:56 +01:00
Split Makfile and move workflow to Makefile (#88)
Co-authored-by: codacy-production[bot] <61871480+codacy-production[bot]@users.noreply.github.com>
This commit is contained in:
parent
662f1a94e4
commit
b669420287
40 changed files with 800 additions and 665 deletions
157
.github/workflows/build_iso.yml
vendored
157
.github/workflows/build_iso.yml
vendored
|
|
@ -1,3 +1,5 @@
|
|||
name: Build ISO
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
|
|
@ -7,16 +9,15 @@ on:
|
|||
parent_job_name:
|
||||
required: true
|
||||
type: string
|
||||
outputs:
|
||||
iso_name-38:
|
||||
description: "Version 38 ISO Name"
|
||||
value: ${{ jobs.build_iso.outputs.iso_name-38 }}
|
||||
iso_name-39:
|
||||
description: "Version 39 ISO Name"
|
||||
value: ${{ jobs.build_iso.outputs.iso_name-39 }}
|
||||
iso_name-40:
|
||||
description: "Version 40 ISO Name"
|
||||
value: ${{ jobs.build_iso.outputs.iso_name-40 }}
|
||||
flatpaks_refs:
|
||||
required: false
|
||||
type: string
|
||||
flatpaks_refs_dir:
|
||||
required: false
|
||||
type: string
|
||||
suffix:
|
||||
required: false
|
||||
type: string
|
||||
|
||||
jobs:
|
||||
load_vars:
|
||||
|
|
@ -38,14 +39,7 @@ jobs:
|
|||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- 38
|
||||
- 39
|
||||
- 40
|
||||
outputs:
|
||||
iso_name-38: ${{ steps.save_output.outputs.iso_name-38 }}
|
||||
iso_name-39: ${{ steps.save_output.outputs.iso_name-39 }}
|
||||
iso_name-40: ${{ steps.save_output.outputs.iso_name-40 }}
|
||||
version: ${{ fromJson(needs.load_vars.outputs.BUILD_VERSIONS) }}
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
|
@ -125,25 +119,20 @@ jobs:
|
|||
image_tag: ${{ matrix.version }}
|
||||
version: ${{ matrix.version }}
|
||||
variant: ${{ needs.load_vars.outputs.VARIANT }}
|
||||
flatpak_remote_refs_dir: /github/workspace/${{ needs.load_vars.outputs.FLATPAK_REMOTE_REFS_DIR }}
|
||||
flatpak_remote_refs: ${{ inputs.flatpaks_refs }}
|
||||
flatpak_remote_refs_dir: ${{ inputs.flatpaks_refs_dir }}
|
||||
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
|
||||
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
||||
iso_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}.iso
|
||||
|
||||
- name: Save output
|
||||
id: save_output
|
||||
shell: bash
|
||||
run: |
|
||||
echo "iso_name-${{ matrix.version }}=${{ steps.build.outputs.iso_name}}" >> $GITHUB_OUTPUT
|
||||
iso_name: build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||
|
||||
- name: Upload ISO as artifact
|
||||
id: upload
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ steps.build.outputs.iso_name }}
|
||||
name: ${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}
|
||||
path: |
|
||||
${{ steps.build.outputs.iso_path }}
|
||||
${{ steps.build.outputs.iso_path }}-CHECKSUM
|
||||
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso
|
||||
build/${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}${{ inputs.suffix && format('-{0}', inputs.suffix || '') }}.iso-CHECKSUM
|
||||
if-no-files-found: error
|
||||
retention-days: 0
|
||||
compression-level: 0
|
||||
|
|
@ -159,113 +148,3 @@ jobs:
|
|||
sha: ${{ env.sha }}
|
||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||
|
||||
build_iso_no_flatpaks:
|
||||
name: Build ISO without Flatpaks
|
||||
env:
|
||||
JOB_NAME: Build ISO without Flatpaks
|
||||
runs-on: ubuntu-latest
|
||||
needs:
|
||||
- load_vars
|
||||
permissions:
|
||||
contents: read
|
||||
statuses: write
|
||||
continue-on-error: false
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
version:
|
||||
- 38
|
||||
- 39
|
||||
- 40
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Switch branch
|
||||
if: inputs.pr
|
||||
env:
|
||||
GITHUB_USER: ${{ github.actor }}
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y hub
|
||||
hub pr checkout ${{ inputs.pr }}
|
||||
echo "sha=$(git rev-parse HEAD)" >> $GITHUB_ENV
|
||||
|
||||
- name: Get Current Job Log URL
|
||||
if: inputs.pr && always()
|
||||
uses: Tiryoh/gha-jobid-action@v1
|
||||
id: jobs
|
||||
with:
|
||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||
job_name: "${{ inputs.parent_job_name }} / ${{ env.JOB_NAME }} (${{ matrix.version }})"
|
||||
|
||||
- name: Set status
|
||||
if: inputs.pr && always()
|
||||
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
status: pending
|
||||
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||
sha: ${{ env.sha }}
|
||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||
|
||||
- name: Free Disk Space (Ubuntu)
|
||||
uses: jlumbroso/free-disk-space@main
|
||||
with:
|
||||
# this might remove tools that are actually needed,
|
||||
# if set to "true" but frees about 6 GB
|
||||
tool-cache: false
|
||||
|
||||
# all of these default to true, but feel free to set to
|
||||
# "false" if necessary for your workflow
|
||||
android: true
|
||||
dotnet: true
|
||||
haskell: true
|
||||
large-packages: true
|
||||
docker-images: true
|
||||
swap-storage: true
|
||||
|
||||
- name: Lowercase Registry
|
||||
id: registry_case
|
||||
uses: ASzc/change-string-case-action@v6
|
||||
with:
|
||||
string: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||
|
||||
- name: Get image version
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
|
||||
- name: Login to Registry
|
||||
run: |
|
||||
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
|
||||
|
||||
- name: Build ISO
|
||||
uses: ./
|
||||
id: build
|
||||
with:
|
||||
arch: ${{ needs.load_vars.outputs.ARCH }}
|
||||
image_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}
|
||||
image_repo: ${{ needs.load_vars.outputs.IMAGE_REPO }}
|
||||
image_tag: ${{ matrix.version }}
|
||||
version: ${{ matrix.version }}
|
||||
variant: ${{ needs.load_vars.outputs.VARIANT }}
|
||||
secure_boot_key_url: ${{ needs.load_vars.outputs.SECURE_BOOT_KEY_URL }}
|
||||
enrollment_password: ${{ needs.load_vars.outputs.ENROLLMENT_PASSWORD }}
|
||||
iso_name: ${{ needs.load_vars.outputs.IMAGE_NAME }}-${{ matrix.version }}.iso
|
||||
|
||||
- name: Set status
|
||||
if: inputs.pr && always()
|
||||
uses: myrotvorets/set-commit-status-action@v2.0.1
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
status: ${{ job.status }}
|
||||
context: ${{ env.JOB_NAME }} (${{ matrix.version }})
|
||||
sha: ${{ env.sha }}
|
||||
targetUrl: ${{ steps.jobs.outputs.html_url }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue