diff options
| author | Sean <SNThrailkill@gmail.com> | 2025-03-13 19:30:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-13 20:30:38 -0400 |
| commit | eb0cc45977b7dc47656c117a9ed34cfd66857912 (patch) | |
| tree | 5a4251cc4f7601ad86b1154c493566e1a01d8f31 /.github | |
| parent | f39efa0fddeb1849a1ae0fbb4f9b38a344521f15 (diff) | |
| download | AeroCore-OS-eb0cc45977b7dc47656c117a9ed34cfd66857912.tar.gz AeroCore-OS-eb0cc45977b7dc47656c117a9ed34cfd66857912.zip | |
feat(build-iso): Add ability to generate ISO (#79)
* initial commit of s3 upload for iso
* Updated Readme. Updated build-iso.yml from testing in test repo
* one more note to make it look more balanced
* add artifact upload ability and adjust README to detail how to use
* One more final note to help be explicit about artifact location.
---------
Co-authored-by: Sean Thrailkill <sean@thrailkill.cloud>
Diffstat (limited to '.github')
| -rw-r--r-- | .github/workflows/build-iso.yml | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/.github/workflows/build-iso.yml b/.github/workflows/build-iso.yml new file mode 100644 index 0000000..1083249 --- /dev/null +++ b/.github/workflows/build-iso.yml @@ -0,0 +1,103 @@ +--- +name: Build ISOs + +on: + workflow_dispatch: + inputs: + upload-to-s3: + description: "Upload to S3" + required: false + default: false + type: boolean + platform: + required: true + type: choice + options: + - amd64 + - arm64 + pull_request: + branches: + - main + paths: + - './iso.toml' + - './.github/workflows/build-iso.yml' + - './Justfile' + +env: + IMAGE_REGISTRY: "ghcr.io/${{ github.repository }}" + DEFAULT_TAG: "latest" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +jobs: + build: + name: Build ISOs + runs-on: ${{ inputs.platform == 'amd64' && 'ubuntu-24.04' || 'ubuntu-24.04-arm' }} + strategy: + fail-fast: false + permissions: + contents: read + packages: read + id-token: write + + steps: + - name: lower case the image registry in case of any capitalization + run: | + echo "IMAGE_REGISTRY=${IMAGE_REGISTRY,,}" >> ${GITHUB_ENV} + + - name: Install dependencies + if: inputs.platform == 'arm64' + run: | + set -x + sudo apt update -y + sudo apt install -y \ + podman + + - name: Maximize build space + if: inputs.platform != 'arm64' + uses: ublue-os/remove-unwanted-software@cc0becac701cf642c8f0a6613bbdaf5dc36b259e # v9 + with: + remove-codeql: true + + - name: Checkout + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 + + - name: Setup Just + uses: extractions/setup-just@dd310ad5a97d8e7b41793f8ef055398d51ad4de6 # v2 + + - name: Build ISO + id: build + uses: ublue-os/bootc-image-builder-action@main + with: + bootc-image-builder-image: ghcr.io/centos-workstation/bootc-image-builder:latest + use-librepo: true + config-file: ./iso.toml + image: ${{ env.IMAGE_REGISTRY }}:${{ env.DEFAULT_TAG }} + + - name: Upload ISOs and Checksum to Job Artifacts + if: inputs.upload-to-s3 != true && github.event_name != 'pull_request' + uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4 + with: + path: ${{ steps.build.outputs.output-directory }} + if-no-files-found: error + retention-days: 0 + compression-level: 0 + overwrite: true + + - name: Upload to S3 + if: inputs.upload-to-s3 == true && github.event_name != 'pull_request' + shell: bash + env: + RCLONE_CONFIG_S3_TYPE: s3 + RCLONE_CONFIG_S3_PROVIDER: ${{ secrets.S3_PROVIDER }} + RCLONE_CONFIG_S3_ACCESS_KEY_ID: ${{ secrets.S3_ACCESS_KEY_ID }} + RCLONE_CONFIG_S3_SECRET_ACCESS_KEY: ${{ secrets.S3_SECRET_ACCESS_KEY }} + RCLONE_CONFIG_S3_REGION: ${{ secrets.S3_REGION }} + RCLONE_CONFIG_S3_ENDPOINT: ${{ secrets.S3_ENDPOINT }} + SOURCE_DIR: ${{ steps.build.outputs.output-directory }} + run: | + sudo apt-get update + sudo apt-get install -y rclone + rclone copy $SOURCE_DIR S3:${{ secrets.S3_BUCKET_NAME }}
\ No newline at end of file |
