1
0
Fork 0
mirror of https://github.com/JasonN3/build-container-installer.git synced 2025-12-25 10:57:55 +01:00

feat: pull back updates from downstream (#14)

This commit is contained in:
Jason N 2024-02-27 12:42:24 -05:00 committed by GitHub
parent 72f665c64a
commit 97b27601f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 463 additions and 182 deletions

104
.github/workflows/build-and-test.yml vendored Normal file
View file

@ -0,0 +1,104 @@
name: Create and publish an ISO
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
# Test Values
env:
ARCH: 'x86_64'
IMAGE_NAME: 'base'
IMAGE_REPO: 'quay.io/fedora-ostree-desktops'
VERSION: '39'
VARIANT: 'Server'
jobs:
build-container:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
- name: Buildah Build
id: build-image
uses: redhat-actions/buildah-build@v2
with:
containerfiles: Containerfile
tags: ${{ steps.meta.outputs.tags }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
username: ${{ github.actor }}
password: ${{ github.token }}
build-and-push-iso:
runs-on: ubuntu-latest
needs:
- build-container
permissions:
contents: read
packages: write
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_REPO }}
- name: Get image version
id: meta
uses: docker/metadata-action@v5
with:
tags: |
type=ref,event=branch
type=ref,event=pr
- name: Build ISO
uses: ./
with:
arch: ${{ env.ARCH}}
image_name: ${{ env.IMAGE_NAME}}
image_repo: ${{ env.IMAGE_REPO}}
version: ${{ env.VERSION }}
variant: ${{ env.VARIANT }}
action_version: ${{ steps.meta.outputs.tags }}
- name: Rename ISO
run: |
mv build/deploy.iso build/${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
- name: Upload ISO as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME }}-${{ env.VERSION }}.iso
path: build/*.iso
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true

View file

@ -1,112 +0,0 @@
name: Create and publish an ISO
on:
push:
branches:
- 'main'
tags:
- 'v*'
pull_request:
workflow_call:
inputs:
IMAGE_VERSION:
required: true
type: string
IMAGE_ARCH:
required: true
type: string
IMAGE_NAME:
required: true
type: string
IMAGE_REPO:
required: true
type: string
VARIANT:
required: true
type: string
BUILD_REPO:
required: false
type: string
default: JasonN3/container-installer
BUILD_REF:
required: false
type: string
default: main
env:
IMAGE_VERSION: ${{ inputs.IMAGE_VERSION || '39' }}
IMAGE_ARCH: ${{ inputs.IMAGE_ARCH || 'x86_64' }}
IMAGE_NAME: ${{ inputs.IMAGE_NAME || 'base-main' }}
IMAGE_REPO: ${{ inputs.IMAGE_REPO || 'ghcr.io/ublue-os' }}
VARIANT: ${{ inputs.VARIANT || 'Silverblue' }}
CURR_REPO: ${{ inputs.BUILD_REPO || github.repository }}
CURR_REF: ${{ inputs.BUILD_REF || github.ref }}
jobs:
build-and-push-iso:
runs-on: ubuntu-latest
container:
image: fedora:39
options: "--privileged"
permissions:
contents: read
packages: write
steps:
- name: Install make and git
run: dnf install -y make git
- name: Checkout repository
uses: actions/checkout@v4
with:
repository: ${{ env.CURR_REPO }}
ref: ${{ env.CURR_REF }}
submodules: recursive
- name: Install dependencies
run: make install-deps
- name: Lowercase Registry
id: registry_case
uses: ASzc/change-string-case-action@v6
with:
string: ${{ env.IMAGE_REPO }}
- name: Download image
run: |
make container/${IMAGE_NAME}-${IMAGE_VERSION} \
arch=${IMAGE_ARCH} \
version=${IMAGE_VERSION} \
image_repo=${{ steps.registry_case.outputs.lowercase }} \
image_name=${IMAGE_NAME} \
variant=${VARIANT}
- name: Create boot.iso
run: |
make boot.iso \
arch=${IMAGE_ARCH} \
version=${IMAGE_VERSION} \
image_repo=${{ steps.registry_case.outputs.lowercase }} \
image_name=${IMAGE_NAME} \
variant=${VARIANT}
- name: Create deploy.iso
run: |
make ${IMAGE_NAME}-${IMAGE_VERSION}.iso \
arch=${IMAGE_ARCH} \
version=${IMAGE_VERSION} \
image_repo=${{ steps.registry_case.outputs.lowercase }} \
image_name=${IMAGE_NAME} \
variant=${VARIANT}
mkdir end_iso
mv ${IMAGE_NAME}-${IMAGE_VERSION}.iso end_iso/
- name: Upload ISO as artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.IMAGE_NAME }}-${{ env.IMAGE_VERSION }}.iso
path: end_iso/*.iso
if-no-files-found: error
retention-days: 0
compression-level: 0
overwrite: true

34
.github/workflows/release.yml vendored Normal file
View file

@ -0,0 +1,34 @@
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Create Draft Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref_name }}
release_name: "Release ${{ github.ref_name }}"
draft: true
prerelease: false
#- uses: actions/upload-release-asset@v1.0.1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: ./my-artifact.zip
# asset_name: my-artifact.zip
# asset_content_type: application/zip
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}