diff --git a/.ci.sh b/.ci.sh deleted file mode 100755 index 378ae89..0000000 --- a/.ci.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/bash - -step="$1" - -function die() { - echo "Error: $1" - exit 255 -} - -function step_build_tree() { - tree="$1" - ostree_repo="$2" - - container_hostname="$(hostname -f)" - container_image="fedora:37" - start_time="$(date +%s)" - - ./build.sh \ - --container \ - --tree "$tree" \ - --vendor "sodaliterocks" \ - --working-dir "$ostree_repo" \ - --ex-container-hostname "$container_hostname" \ - --ex-container-image "$container_image" \ - --ex-override-starttime "$start_time" \ - --ex-print-github-release-table-row - - if [[ $? != 0 ]]; then - die "Failed to build" - fi -} - -function step_checkout_branch() { - branch="$1" - git checkout $branch -} - -function step_update_submodules() { - git submodule sync - git submodule update --init --recursive -} - -function step_test_environment() { - if [[ $(id -u) != 0 ]]; then - die "Unauthorized (are you root?)" - fi -} - -shift - -case $step in - "build-tree") step_build_tree $1 $2 ;; - "checkout-branch") step_checkout_branch $1 $2 ;; - "test-environment") step_test_environment ;; - "update-submodules") step_update_submodules ;; - *) - die "Step '$step' does not exist" -esac diff --git a/.github/actions/ci/action.yml b/.github/actions/ci/action.yml new file mode 100644 index 0000000..22c3fd7 --- /dev/null +++ b/.github/actions/ci/action.yml @@ -0,0 +1,53 @@ +name: CI +inputs: + branch: + type: string + container_image: + required: false + type: string + dry_run: + required: false + type: boolean + tree: + required: true + type: string +runs: + using: "composite" + steps: + - if: ${{ inputs.branch != '' }} + run: git checkout ${{ inputs.branch }} + shell: bash + - run: git fetch --tags origin + shell: bash + - run: git submodule sync + shell: bash + - run: git submodule update --init --recursive + shell: bash + - run: | + function test_input() { + [[ "$1" != "" ]] && echo "$1" || echo "$2" + } + start_time="$(date +%s)" + if [[ "${{ inputs.dry_run }}" != "" ]]; then + working_dir="/tmp/sodalite-build-$start_time" + ./build.sh \ + --container \ + --tree "${{ inputs.tree }}" \ + --vendor "sodaliterocks" \ + --working-dir "$working_dir" \ + --ex-container-hostname "$(hostname -f)" \ + --ex-container-image "$(test_input "${{ inputs.container_image }}" "fedora:37")" \ + --ex-override-starttime "$start_time" + rm -rf "$working_dir" + else + ./build.sh \ + --container \ + --tree "${{ inputs.tree }}" \ + --vendor "sodaliterocks" \ + --working-dir "/srv/store/variable/ostree" \ + --ex-container-hostname "$(hostname -f)" \ + --ex-container-image "$(test_input "${{ inputs.container_image }}" "fedora:37")" \ + --ex-override-starttime "$start_time" \ + --ex-print-github-release-table-row + fi + shell: bash diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 570739c..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: CI - -on: - workflow_call: - inputs: - branch: - type: string - repo: - type: string - tree: - required: true - type: string - -jobs: - ci: - runs-on: self-hosted - steps: - - uses: actions/checkout@v3 - - - name: Test environment - run: ./.ci.sh test-environment - - - name: Checkout branch - if: ${{ inputs.branch != '' }} - run: ./.ci.sh checkout-branch ${{ inputs.branch }} - - - name: Update submodules - run: ./.ci.sh update-submodules - - - name: Build tree - run: ./.ci.sh build-tree ${{ inputs.tree }} ${{ inputs.repo }} diff --git a/.github/workflows/update-manual.yml b/.github/workflows/update-manual.yml deleted file mode 100644 index d8bc2f5..0000000 --- a/.github/workflows/update-manual.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Update (Manual) - -on: - workflow_dispatch: - inputs: - tree: - default: desktop - description: "Tree" - required: true - type: choice - options: - - desktop - - desktop-budgie - - desktop-deepin - - desktop-gnome - - derp - -jobs: - custom: - name: Update (Manual) - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - repo: /srv/store/variable/ostree - tree: ${{ inputs.tree }} diff --git a/.github/workflows/update-scheduled.yml b/.github/workflows/update-scheduled.yml deleted file mode 100644 index 7eb0c78..0000000 --- a/.github/workflows/update-scheduled.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Update (Scheduled) - -on: - schedule: - - cron: '0 4 * * 3,6' - workflow_dispatch: - -jobs: - desktop: - name: "Update: Desktop (Current)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: release/current - repo: /srv/store/variable/ostree - tree: desktop - - desktop--long-4: - name: "Update: Desktop (Long 4)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: release/long/4 - repo: /srv/store/variable/ostree - tree: desktop - - desktop--next: - name: "Update: Desktop (Next)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: release/next - repo: /srv/store/variable/ostree - tree: desktop - - desktop--devel: - name: "Update: Desktop (Devel)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: main - repo: /srv/store/variable/ostree - tree: desktop - - desktop-budgie--devel: - name: "Update: Budgie (Devel)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: main - repo: /srv/store/variable/ostree - tree: desktop-budgie - - desktop-deepin--devel: - name: "Update: Deepin (Devel)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: main - repo: /srv/store/variable/ostree - tree: desktop-deepin - - desktop-gnome--devel: - name: "Update: GNOME (Devel)" - uses: sodaliterocks/sodalite/.github/workflows/ci.yml@main - with: - branch: main - repo: /srv/store/variable/ostree - tree: desktop-gnome diff --git a/.github/workflows/update.manual.yml b/.github/workflows/update.manual.yml new file mode 100644 index 0000000..2adffc5 --- /dev/null +++ b/.github/workflows/update.manual.yml @@ -0,0 +1,41 @@ +name: Update (Manual) + +on: + workflow_dispatch: + inputs: + tree: + default: desktop + description: "Tree" + required: true + type: choice + options: + - desktop + - desktop-budgie + - desktop-deepin + - desktop-gnome + dry_run: + default: false + description: "Dry Run" + type: boolean + container_image: + default: fedora:37 + description: "Container Image" + required: true + type: choice + options: + - "fedora:latest" + - "fedora:36" + - "fedora:37" + - "fedora:38" + - "fedora:39" + - "fedora:rawhide" + +jobs: + custom: + name: "Custom" + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/ci + with: + tree: ${{ inputs.tree }} diff --git a/.github/workflows/update.scheduled.current.yml b/.github/workflows/update.scheduled.current.yml new file mode 100644 index 0000000..0367938 --- /dev/null +++ b/.github/workflows/update.scheduled.current.yml @@ -0,0 +1,16 @@ +name: "Update: Current" + +on: + schedule: + - cron: '0 4 * * 3,6' # At 04:00 on Wednesday and Saturday + +jobs: + desktop: + name: "Desktop" + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/ci + with: + branch: release/current + tree: desktop diff --git a/.github/workflows/update.scheduled.long-4.yml b/.github/workflows/update.scheduled.long-4.yml new file mode 100644 index 0000000..eb6e1e7 --- /dev/null +++ b/.github/workflows/update.scheduled.long-4.yml @@ -0,0 +1,16 @@ +name: "Update: Long (4)" + +on: + schedule: + - cron: '0 4 * * 3,6' # At 04:00 on Wednesday and Saturday + +jobs: + desktop: + name: "Desktop" + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/ci + with: + branch: release/long/4 + tree: desktop diff --git a/.github/workflows/update.scheduled.next.yml b/.github/workflows/update.scheduled.next.yml new file mode 100644 index 0000000..1ce1752 --- /dev/null +++ b/.github/workflows/update.scheduled.next.yml @@ -0,0 +1,16 @@ +name: "Update: Next" + +on: + schedule: + - cron: '0 4 * * 3,6' # At 04:00 on Wednesday and Saturday + +jobs: + desktop: + name: "Desktop" + runs-on: self-hosted + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/ci + with: + branch: release/next + tree: desktop diff --git a/build.sh b/build.sh index cb3c56c..7c02339 100755 --- a/build.sh +++ b/build.sh @@ -470,6 +470,7 @@ function main() { [[ $ex_ntfy_password != "" ]] && container_build_args+=" --ex-ntfy-password $ex_ntfy_password" [[ $ex_ntfy_topic != "" ]] && container_build_args+=" --ex-ntfy-topic $ex_ntfy_topic" [[ $ex_ntfy_username != "" ]] && container_build_args+=" --ex-ntfy-username $ex_ntfy_username" + [[ $ex_print_github_release_table_row != "" ]] && container_build_args+=" --ex-print-github-release-table-row $ex_print_github_release_table_row" [[ $skip_cleanup != "" ]] && container_build_args+=" --skip-cleanup $skip_cleanup" [[ $skip_test != "" ]] && container_build_args+=" --skip-test $skip_test" [[ $tree != "" ]] && container_build_args+=" --tree $tree" diff --git a/src/cores/common.yaml b/src/cores/common.yaml index 3fea608..e92803e 100644 --- a/src/cores/common.yaml +++ b/src/cores/common.yaml @@ -6,7 +6,7 @@ include: [ ] releasever: "37" -automatic-version-prefix: "4.1-" +automatic-version-prefix: "4.2-" automatic-version-suffix: "." mutate-os-release: "${releasever}"