From 05c9b9bd017e8e20b70bd791e1f04cabd6664cd4 Mon Sep 17 00:00:00 2001 From: tranch Date: Sat, 25 Jul 2026 23:28:23 +0800 Subject: Add branch-aware versioned image tags Generate Fedora/date version tags and publish stable or testing aliases from the corresponding Git branch. --- .github/workflows/build.yml | 58 ++++++++++++++++++++++++++++----------------- 1 file changed, 36 insertions(+), 22 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 221c735..6a59b2a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,11 +4,13 @@ on: push: branches: - main + - testing pull_request: branches: - main - schedule: - - cron: '05 10 * * *' # 10:05am UTC everyday + - testing + #schedule: + # - cron: '05 10 * * *' # 10:05am UTC everyday workflow_dispatch: env: @@ -74,16 +76,36 @@ jobs: echo "IMAGE_NAME=${IMAGE_NAME}" >> "$GITHUB_ENV" - - name: Default Tag - id: gen-default-tag + - name: Generate Version and Tags + id: gen-version + env: + BASE_IMAGE: ${{ vars.BASE_IMAGE || 'ghcr.io/ublue-os/bazzite-deck:stable' }} run: | - if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${GITHUB_REF_NAME}" == "testing" ]]; then - DEFAULT_TAG="testing-$(date -u +%Y%m%d)" + set -euo pipefail + + sudo podman pull "${BASE_IMAGE}" + FEDORA_VERSION=$(sudo podman run --rm --entrypoint /usr/bin/rpm "${BASE_IMAGE}" -E %fedora) + VERSION_BASE="${FEDORA_VERSION}.$(date -u +%Y%m%d)" + + if [[ "${GITHUB_REF_NAME}" == "testing" ]]; then + VERSION_TAG="testing-${VERSION_BASE}" + VERSION_PRETTY="Testing (F${VERSION_BASE})" + IMAGE_BRANCH="testing" + ALIAS_TAGS="${VERSION_TAG} testing testing-${FEDORA_VERSION}" else - DEFAULT_TAG=$(just generate-default-tag) + VERSION_TAG="${VERSION_BASE}" + VERSION_PRETTY="Stable (F${VERSION_BASE})" + IMAGE_BRANCH="stable" + ALIAS_TAGS="${VERSION_TAG} stable-${VERSION_TAG} latest stable stable-${FEDORA_VERSION}" fi - echo "DEFAULT_TAG=${DEFAULT_TAG}" >> "$GITHUB_ENV" + { + echo "DEFAULT_TAG=${VERSION_TAG}" + echo "IMAGE_BRANCH=${IMAGE_BRANCH}" + echo "VERSION_TAG=${VERSION_TAG}" + echo "VERSION_PRETTY=${VERSION_PRETTY}" + echo "ALIAS_TAGS=${ALIAS_TAGS}" + } >> "$GITHUB_ENV" - name: Prepare environment run: | @@ -130,17 +152,9 @@ jobs: - name: Generate Build Tags id: gen-build-tags run: | - if [[ "${GITHUB_EVENT_NAME}" == "workflow_dispatch" && "${GITHUB_REF_NAME}" == "testing" ]]; then - alias_tags="testing ${DEFAULT_TAG}" - else - alias_tags="$(just generate-build-tags \ - "${IMAGE_NAME}" \ - "${DEFAULT_TAG}")" - fi - echo "Tags for this Action..." - echo "${alias_tags}" - echo "alias_tags=${alias_tags}" >> "$GITHUB_OUTPUT" + echo "${ALIAS_TAGS}" + echo "alias_tags=${ALIAS_TAGS}" >> "$GITHUB_OUTPUT" - name: Tag Image id: tag-images @@ -156,14 +170,14 @@ jobs: # They publish default-branch builds and manual testing branch builds. - name: Login to GitHub Container Registry uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0 - if: github.event_name != 'pull_request' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/testing')) + if: github.event_name != 'pull_request' && (github.ref_name == github.event.repository.default_branch || github.ref_name == 'testing') with: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} - name: Push To GHCR - if: github.event_name != 'pull_request' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/testing')) + if: github.event_name != 'pull_request' && (github.ref_name == github.event.repository.default_branch || github.ref_name == 'testing') id: push-image env: ALIAS_TAGS: ${{ steps.gen-build-tags.outputs.alias_tags }} @@ -184,14 +198,14 @@ jobs: # to consume. For more details, review the image signing section of the README. - name: Install Cosign uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 - if: github.event_name != 'pull_request' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/testing')) + if: github.event_name != 'pull_request' && (github.ref_name == github.event.repository.default_branch || github.ref_name == 'testing') # https://github.com/containers/container-libs/issues/388 with: cosign-release: 'v2.6.3' - name: Sign container image id: sign-image - if: github.event_name != 'pull_request' && (github.ref == format('refs/heads/{0}', github.event.repository.default_branch) || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/testing')) + if: github.event_name != 'pull_request' && (github.ref_name == github.event.repository.default_branch || github.ref_name == 'testing') env: COSIGN_EXPERIMENTAL: false COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }} -- cgit v1.2.3 From 21c68e32f7a8d77876ba782016a8063c42167963 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 26 Jul 2026 01:23:31 +0800 Subject: Make stable the default image channel Keep latest as a main-branch alias while using Fedora/date versions for image metadata and release tags. --- .github/workflows/build.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a59b2a..97bfd91 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -88,11 +88,13 @@ jobs: VERSION_BASE="${FEDORA_VERSION}.$(date -u +%Y%m%d)" if [[ "${GITHUB_REF_NAME}" == "testing" ]]; then + DEFAULT_TAG="testing" VERSION_TAG="testing-${VERSION_BASE}" VERSION_PRETTY="Testing (F${VERSION_BASE})" IMAGE_BRANCH="testing" ALIAS_TAGS="${VERSION_TAG} testing testing-${FEDORA_VERSION}" else + DEFAULT_TAG="stable" VERSION_TAG="${VERSION_BASE}" VERSION_PRETTY="Stable (F${VERSION_BASE})" IMAGE_BRANCH="stable" @@ -100,7 +102,7 @@ jobs: fi { - echo "DEFAULT_TAG=${VERSION_TAG}" + echo "DEFAULT_TAG=${DEFAULT_TAG}" echo "IMAGE_BRANCH=${IMAGE_BRANCH}" echo "VERSION_TAG=${VERSION_TAG}" echo "VERSION_PRETTY=${VERSION_PRETTY}" -- cgit v1.2.3 From 02f76b85f9ebcb198184599a6b18f5c885280a43 Mon Sep 17 00:00:00 2001 From: tranch Date: Sun, 26 Jul 2026 01:32:34 +0800 Subject: Run lightweight checks for pull requests --- .github/workflows/build.yml | 4 ---- .github/workflows/validate-installer-iso.yml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 13 deletions(-) (limited to '.github') diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 97bfd91..b9d12cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,10 +5,6 @@ on: branches: - main - testing - pull_request: - branches: - - main - - testing #schedule: # - cron: '05 10 * * *' # 10:05am UTC everyday workflow_dispatch: diff --git a/.github/workflows/validate-installer-iso.yml b/.github/workflows/validate-installer-iso.yml index 37f5496..131ad5b 100644 --- a/.github/workflows/validate-installer-iso.yml +++ b/.github/workflows/validate-installer-iso.yml @@ -1,20 +1,17 @@ -name: Validate installer ISO +name: Validate pull request on: pull_request: - paths: - - "Justfile" - - "installer/**" - - "just_scripts/build-installer-iso.sh" - - ".github/workflows/build-installer-iso.yml" - - ".github/workflows/validate-installer-iso.yml" + branches: + - main + - testing permissions: contents: read jobs: - validate-installer-iso: - name: Validate installer ISO inputs + validate: + name: Run lightweight checks runs-on: ubuntu-24.04 steps: @@ -28,6 +25,9 @@ jobs: run: | ruby -e 'require "yaml"; Dir[".github/workflows/*.yml"].each { |file| YAML.load_file(file) }' + - name: Validate Just syntax + run: just check + - name: Validate Justfile formatting run: | just --unstable --fmt --check -f Justfile -- cgit v1.2.3