From f42a7f909dacf791f5d79a2f346f89bb02a92c08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 10:07:27 +0200 Subject: [PATCH 01/32] GitHub Actions: update systemsmanagement:Agama:Staging/agama-cli in OBS --- .github/workflows/configure_osc.sh | 15 ++++++ .github/workflows/obs-staging-rust.yml | 67 ++++++++++++++++++++++++++ .github/workflows/oscrc.template | 7 +++ 3 files changed, 89 insertions(+) create mode 100755 .github/workflows/configure_osc.sh create mode 100644 .github/workflows/obs-staging-rust.yml create mode 100644 .github/workflows/oscrc.template diff --git a/.github/workflows/configure_osc.sh b/.github/workflows/configure_osc.sh new file mode 100755 index 0000000000..193164b463 --- /dev/null +++ b/.github/workflows/configure_osc.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +# This helper script creates the "osc" configuration file with OBS credentials + +CONFIG_FILE="$HOME/.config/osc/oscrc" + +# do not overwrite the existing config accidentally +if [ -e "$CONFIG_FILE" ]; then + echo "ERROR: $CONFIG_FILE already exists" + exit 1 +fi + +TEMPLATE=$(dirname "${BASH_SOURCE[0]}")/oscrc.template +mkdir -p $(dirname "$CONFIG_FILE") +sed -e "s/@OBS_USER@/$OBS_USER/g" -e "s/@OBS_PASSWORD@/$OBS_PASSWORD/g" "$TEMPLATE" > "$CONFIG_FILE" diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml new file mode 100644 index 0000000000..25cf28e013 --- /dev/null +++ b/.github/workflows/obs-staging-rust.yml @@ -0,0 +1,67 @@ +name: OBS Staging (agama-cli) + +on: + # runs on pushes targeting the default branch + push: + branches: + - master + # FIXME: remove this before merging + - obs_sync + paths: + # run only when a Rust source is changed + - rust/** + + # allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + update_staging: + # do not run in forks + if: github.repository == 'openSUSE/agama' + + runs-on: ubuntu-latest + + container: + image: registry.opensuse.org/opensuse/tumbleweed:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Configure and refresh repositories + # disable unused repositories to have a faster refresh + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) + + - name: Install tools + run: zypper --non-interactive install --no-recommends + cpio + obs-service-cargo_audit + obs-service-cargo_vendor + obs-service-download_files + obs-service-format_spec_file + obs-service-obs_scm + obs-service-set_version + obs-service-tar + osc + + - name: Configure osc + run: .github/workflows/configure_osc.sh + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + + - name: Checkout agama-cli + run: osc co systemsmanagement:Agama:Staging agama-cli + + - name: Update agama-cli + run: osc service runall + working-directory: ./systemsmanagement:Agama:Staging/agama-cli + + - name: Check agama-cli + run: osc status + working-directory: ./systemsmanagement:Agama:Staging/agama-cli + + - name: Commit agama-cli + run: osc commit -m "Updating to Git commit $GITHUB_SHA" + working-directory: ./systemsmanagement:Agama:Staging/agama-cli diff --git a/.github/workflows/oscrc.template b/.github/workflows/oscrc.template new file mode 100644 index 0000000000..e6133a0677 --- /dev/null +++ b/.github/workflows/oscrc.template @@ -0,0 +1,7 @@ +[general] +apiurl = https://api.opensuse.org + +[https://api.opensuse.org] +user=@OBS_USER@ +pass=@OBS_PASSWORD@ +credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager From e8a7e5e831fee79bcc4fc00c43f69043e2f60eac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 10:51:30 +0200 Subject: [PATCH 02/32] Update playwright test package --- .github/workflows/obs-staging-playwright.yml | 65 ++++++++++++++++++++ .github/workflows/obs-staging-rust.yml | 12 ++-- README.md | 4 ++ 3 files changed, 75 insertions(+), 6 deletions(-) create mode 100644 .github/workflows/obs-staging-playwright.yml diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml new file mode 100644 index 0000000000..ed54110649 --- /dev/null +++ b/.github/workflows/obs-staging-playwright.yml @@ -0,0 +1,65 @@ +name: OBS Staging (cockpit-agama-playwright) + +on: + # runs on pushes targeting the default branch + push: + branches: + - master + # FIXME: remove this before merging + - obs_sync + # FIXME: enable before merging + # paths: + # # run only when a Playwright source is changed + # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + # - playwright/** + + # allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + update_staging: + # do not run in forks + if: github.repository == 'openSUSE/agama' + + runs-on: ubuntu-latest + + container: + image: registry.opensuse.org/opensuse/tumbleweed:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Configure and refresh repositories + # disable unused repositories to have a faster refresh + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) + + - name: Install tools + run: zypper --non-interactive install --no-recommends + cpio + obs-service-download_files + obs-service-format_spec_file + obs-service-obs_scm + osc + + - name: Configure osc + run: .github/workflows/configure_osc.sh + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + + - name: Checkout cockpit-agama-playwright + run: osc co systemsmanagement:Agama:Staging cockpit-agama-playwright + + - name: Update cockpit-agama-playwright + run: osc service manualrun + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright + + - name: Check cockpit-agama-playwright + run: osc status + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright + + - name: Commit cockpit-agama-playwright + run: osc commit -m "Updating to Git commit $GITHUB_SHA" + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 25cf28e013..6256376145 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -7,9 +7,11 @@ on: - master # FIXME: remove this before merging - obs_sync - paths: - # run only when a Rust source is changed - - rust/** + # FIXME: enable before merging + # paths: + # # run only when a Rust source is changed + # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + # - rust/** # allows you to run this workflow manually from the Actions tab workflow_dispatch: @@ -41,8 +43,6 @@ jobs: obs-service-download_files obs-service-format_spec_file obs-service-obs_scm - obs-service-set_version - obs-service-tar osc - name: Configure osc @@ -55,7 +55,7 @@ jobs: run: osc co systemsmanagement:Agama:Staging agama-cli - name: Update agama-cli - run: osc service runall + run: osc service manualrun working-directory: ./systemsmanagement:Agama:Staging/agama-cli - name: Check agama-cli diff --git a/README.md b/README.md index 1dde91cd16..9ff1f97512 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,10 @@ [![CI Status](https://github.com/openSUSE/agama/actions/workflows/ci.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/ci.yml) [![Coverage Status](https://coveralls.io/repos/github/openSUSE/agama/badge.svg?branch=master)](https://coveralls.io/github/openSUSE/agama?branch=master) +**[OBS systemsmanagement:Agama:Staging](https://build.opensuse.org/project/show/systemsmanagement:Agama:Staging)** + +[![OBS Staging (agama-cli)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-rust.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-rust.yml) + # Agama: A Service-based Linux Installer Agama is a new Linux installer born in the core of the YaST team. It is designed to offer re-usability, integration with third party tools and the possibility of building advanced user interfaces over it. From 5a028e4abb637b925a09eb0ec860a5e65030ce02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 14:08:51 +0200 Subject: [PATCH 03/32] Update cockpit-agama package --- .github/workflows/obs-staging-playwright.yml | 2 +- .github/workflows/obs-staging-rust.yml | 2 +- .github/workflows/obs-staging-web.yml | 66 ++++++++++++++++++++ 3 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/obs-staging-web.yml diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index ed54110649..0b3a687efe 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -1,4 +1,4 @@ -name: OBS Staging (cockpit-agama-playwright) +name: OBS:Staging (cockpit-agama-playwright) on: # runs on pushes targeting the default branch diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 6256376145..e8a2a01a7a 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -1,4 +1,4 @@ -name: OBS Staging (agama-cli) +name: OBS:Staging (agama-cli) on: # runs on pushes targeting the default branch diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml new file mode 100644 index 0000000000..59946c79cd --- /dev/null +++ b/.github/workflows/obs-staging-web.yml @@ -0,0 +1,66 @@ +name: OBS:Staging (cockpit-agama) + +on: + # runs on pushes targeting the default branch + push: + branches: + - master + # FIXME: remove this before merging + - obs_sync + # FIXME: enable before merging + # paths: + # # run only when a web frontend source is changed + # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + # - web/** + + # allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + update_staging: + # do not run in forks + if: github.repository == 'openSUSE/agama' + + runs-on: ubuntu-latest + + container: + image: registry.opensuse.org/opensuse/tumbleweed:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Configure and refresh repositories + # disable unused repositories to have a faster refresh + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref + + - name: Install tools + run: zypper --non-interactive install --no-recommends + cpio + obs-service-download_files + obs-service-format_spec_file + obs-service-node_modules + obs-service-obs_scm + osc + + - name: Configure osc + run: .github/workflows/configure_osc.sh + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + + - name: Checkout cockpit-agama + run: osc co systemsmanagement:Agama:Staging cockpit-agama + + - name: Update cockpit-agama + run: osc service manualrun + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama + + - name: Check cockpit-agama + run: osc status + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama + + - name: Commit cockpit-agama + run: osc commit -m "Updating to Git commit $GITHUB_SHA" + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama From 7f9f130329d5190d78468f879e68e0848fe868c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 18:23:32 +0200 Subject: [PATCH 04/32] Update rubygem-agama package --- .github/workflows/obs-staging-playwright.yml | 2 +- .github/workflows/obs-staging-rust.yml | 2 +- .github/workflows/obs-staging-service.yml | 78 ++++++++++++++++++++ 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/obs-staging-service.yml diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index 0b3a687efe..6e91b37523 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -33,7 +33,7 @@ jobs: - name: Configure and refresh repositories # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - name: Install tools run: zypper --non-interactive install --no-recommends diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index e8a2a01a7a..a104732e89 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -33,7 +33,7 @@ jobs: - name: Configure and refresh repositories # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && ( zypper ref || zypper ref || zypper ref ) + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - name: Install tools run: zypper --non-interactive install --no-recommends diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml new file mode 100644 index 0000000000..3b68ecc971 --- /dev/null +++ b/.github/workflows/obs-staging-service.yml @@ -0,0 +1,78 @@ +name: OBS:Staging (rubygem-agama) + +on: + # runs on pushes targeting the default branch + push: + branches: + - master + # FIXME: remove this before merging + - obs_sync + # FIXME: enable before merging + # paths: + # # run only when a service source is changed + # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet + # - service/** + + # allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +jobs: + update_staging: + # do not run in forks + if: github.repository == 'openSUSE/agama' + + runs-on: ubuntu-latest + + container: + image: registry.opensuse.org/opensuse/tumbleweed:latest + + steps: + + - name: Git Checkout + uses: actions/checkout@v3 + with: + # fetch all history, we need to find the latest tag and offset for the version number + fetch-depth: 0 + + - name: Configure and refresh repositories + # disable unused repositories to have a faster refresh + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref + + - name: Install tools + run: zypper --non-interactive install --no-recommends + git + osc + ruby + 'rubygem(gem2rpm)' + + - name: Generate version number + run: git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > service/VERSION + + - name: Update agma rubygem + run: gem build agama.gemspec + working-directory: ./service + + - name: Generate RPM spec file + run: gem2rpm --local --config package/gem2rpm.yml agama-*.gem > package/rubygem-agama.spec + working-directory: ./service + + - name: Configure osc + run: .github/workflows/configure_osc.sh + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + + - name: Checkout rubygem-agama + run: osc co systemsmanagement:Agama:Staging rubygem-agama + + - name: Update files + run: rm ./systemsmanagement:Agama:Staging/rubygem-agama/*; + cp service/agama-*.gem service/package/* ./systemsmanagement:Agama:Staging/rubygem-agama + + - name: Check rubygem-agama + run: osc addremove && osc status + working-directory: ./systemsmanagement:Agama:Staging/rubygem-agama + + - name: Commit rubygem-agama + run: osc commit -m "Updating to $(cat ../../service/VERSION) ($GITHUB_SHA)" + working-directory: ./systemsmanagement:Agama:Staging/rubygem-agama From 2d045b190acd6c5df12e3a97febf64adb18aac00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 18:28:00 +0200 Subject: [PATCH 05/32] Fixed cloning --- .github/workflows/obs-staging-service.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 3b68ecc971..8b8d5a98fb 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -28,12 +28,6 @@ jobs: steps: - - name: Git Checkout - uses: actions/checkout@v3 - with: - # fetch all history, we need to find the latest tag and offset for the version number - fetch-depth: 0 - - name: Configure and refresh repositories # disable unused repositories to have a faster refresh run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref @@ -45,6 +39,12 @@ jobs: ruby 'rubygem(gem2rpm)' + - name: Git Checkout + uses: actions/checkout@v3 + with: + # fetch all history, we need to find the latest tag and offset for the version number + fetch-depth: 0 + - name: Generate version number run: git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > service/VERSION From 9d012109baf9d3b459bbefdf76529177d0da36db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 18:34:45 +0200 Subject: [PATCH 06/32] Fix file owener --- .github/workflows/obs-staging-service.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 8b8d5a98fb..b8385b5cf3 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -45,6 +45,9 @@ jobs: # fetch all history, we need to find the latest tag and offset for the version number fetch-depth: 0 + - name: Fix file owner + run: chown -R -c 0 . + - name: Generate version number run: git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > service/VERSION From 4c8f9b837a9505b0e99c00fc5b0ae4aca25458cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 19:09:02 +0200 Subject: [PATCH 07/32] Better commit message --- .github/workflows/obs-staging-playwright.yml | 3 ++- .github/workflows/obs-staging-rust.yml | 3 ++- .github/workflows/obs-staging-web.yml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index 6e91b37523..baefd12213 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -61,5 +61,6 @@ jobs: working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright - name: Commit cockpit-agama-playwright - run: osc commit -m "Updating to Git commit $GITHUB_SHA" + run: |- + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index a104732e89..9c8502cd4a 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -63,5 +63,6 @@ jobs: working-directory: ./systemsmanagement:Agama:Staging/agama-cli - name: Commit agama-cli - run: osc commit -m "Updating to Git commit $GITHUB_SHA" + run: |- + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" working-directory: ./systemsmanagement:Agama:Staging/agama-cli diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 59946c79cd..737f4231e0 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -62,5 +62,6 @@ jobs: working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama - name: Commit cockpit-agama - run: osc commit -m "Updating to Git commit $GITHUB_SHA" + run: |- + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama From 2acd24340dd08d6ad4c5d5f089352e7ab36bd6ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 6 Jun 2023 19:12:58 +0200 Subject: [PATCH 08/32] Even better commit message :smiley: --- .github/workflows/obs-staging-playwright.yml | 2 +- .github/workflows/obs-staging-rust.yml | 2 +- .github/workflows/obs-staging-web.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index baefd12213..55a41986e4 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -62,5 +62,5 @@ jobs: - name: Commit cockpit-agama-playwright run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 9c8502cd4a..6bbcbb67b8 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -64,5 +64,5 @@ jobs: - name: Commit agama-cli run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" working-directory: ./systemsmanagement:Agama:Staging/agama-cli diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 737f4231e0..26feac5d15 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -63,5 +63,5 @@ jobs: - name: Commit cockpit-agama run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($GITHUB_SHA)" + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama From d65617fb5017357fe27469e8b948c04c52322e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 10:25:40 +0200 Subject: [PATCH 09/32] Try using a shared workflow --- .github/workflows/obs-staging-shared.yml | 67 ++++++++++++++++++++++++ .github/workflows/obs-staging-web.yml | 50 +++--------------- 2 files changed, 73 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/obs-staging-shared.yml diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml new file mode 100644 index 0000000000..38b1db79d2 --- /dev/null +++ b/.github/workflows/obs-staging-shared.yml @@ -0,0 +1,67 @@ +name: Update OBS Staging + +on: + workflow_call: + secrets: + OBS_USER: + required: true + OBS_PASSWORD: + required: true + inputs: + install_packages: + description: Additional packages to install + required: false + type: string + package_name: + description: OBS package name + required: true + type: string + +jobs: + update_staging_package: + runs-on: ubuntu-latest + + container: + image: registry.opensuse.org/opensuse/tumbleweed:latest + + steps: + - name: Test + run: echo -- "$INPUT_INSTALL_PACKAGES $INPUT_PACKAGE_NAME" + + - name: Git Checkout + uses: actions/checkout@v3 + + - name: Configure and refresh repositories + # disable unused repositories to have a faster refresh + run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref + + - name: Install tools + run: zypper --non-interactive install --no-recommends + cpio + obs-service-download_files + obs-service-format_spec_file + obs-service-obs_scm + osc + $INPUT_INSTALL_PACKAGES + + - name: Configure osc + run: .github/workflows/configure_osc.sh + env: + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + + - name: Checkout $INPUT_PACKAGE_NAME - ${{ vars.INPUT_PACKAGE_NAME }} + run: osc co systemsmanagement:Agama:Staging $INPUT_PACKAGE_NAME + + - name: Update cockpit-agama + run: osc service manualrun + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama + + - name: Check cockpit-agama + run: osc status + working-directory: ./systemsmanagement:Agama:Staging/${{ vars.INPUT_PACKAGE_NAME }} + + - name: Commit cockpit-agama + run: |- + osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" + working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 26feac5d15..2a65d53dfa 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -20,48 +20,10 @@ jobs: update_staging: # do not run in forks if: github.repository == 'openSUSE/agama' + uses: ./.github/workflows/obs-staging-shared.yml + # pass all secrets + secrets: inherit + with: + install_packages: obs-service-node_modules + package_name: cockpit-agama - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends - cpio - obs-service-download_files - obs-service-format_spec_file - obs-service-node_modules - obs-service-obs_scm - osc - - - name: Configure osc - run: .github/workflows/configure_osc.sh - env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - - name: Checkout cockpit-agama - run: osc co systemsmanagement:Agama:Staging cockpit-agama - - - name: Update cockpit-agama - run: osc service manualrun - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama - - - name: Check cockpit-agama - run: osc status - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama - - - name: Commit cockpit-agama - run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama From 24bd4537911ff37d4ad46c6ea165b2284e72fc6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 10:35:02 +0200 Subject: [PATCH 10/32] input test --- .github/workflows/obs-staging-shared.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml index 38b1db79d2..0220820e2f 100644 --- a/.github/workflows/obs-staging-shared.yml +++ b/.github/workflows/obs-staging-shared.yml @@ -7,11 +7,13 @@ on: required: true OBS_PASSWORD: required: true + inputs: install_packages: description: Additional packages to install required: false type: string + package_name: description: OBS package name required: true @@ -25,8 +27,10 @@ jobs: image: registry.opensuse.org/opensuse/tumbleweed:latest steps: - - name: Test - run: echo -- "$INPUT_INSTALL_PACKAGES $INPUT_PACKAGE_NAME" + - name: Test ${{ inputs.package_name }} + run: |- + echo Inputs ${{ inputs.install_packages }} ${{ inputs.package_name }} + exit 1 - name: Git Checkout uses: actions/checkout@v3 From d2aa1293cdd7f5be300725d21f4452916a5e3996 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 10:43:02 +0200 Subject: [PATCH 11/32] Use inputs --- .github/workflows/obs-staging-shared.yml | 26 +++++++++++------------- .github/workflows/obs-staging-web.yml | 2 -- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml index 0220820e2f..4c04e72785 100644 --- a/.github/workflows/obs-staging-shared.yml +++ b/.github/workflows/obs-staging-shared.yml @@ -21,17 +21,15 @@ on: jobs: update_staging_package: + # do not run in forks + if: github.repository == 'openSUSE/agama' + runs-on: ubuntu-latest container: image: registry.opensuse.org/opensuse/tumbleweed:latest steps: - - name: Test ${{ inputs.package_name }} - run: |- - echo Inputs ${{ inputs.install_packages }} ${{ inputs.package_name }} - exit 1 - - name: Git Checkout uses: actions/checkout@v3 @@ -46,7 +44,7 @@ jobs: obs-service-format_spec_file obs-service-obs_scm osc - $INPUT_INSTALL_PACKAGES + ${{ inputs.install_packages }} - name: Configure osc run: .github/workflows/configure_osc.sh @@ -54,18 +52,18 @@ jobs: OBS_USER: ${{ secrets.OBS_USER }} OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - name: Checkout $INPUT_PACKAGE_NAME - ${{ vars.INPUT_PACKAGE_NAME }} - run: osc co systemsmanagement:Agama:Staging $INPUT_PACKAGE_NAME + - name: Checkout ${{ inputs.package_name }} + run: osc co systemsmanagement:Agama:Staging ${{ inputs.package_name }} - - name: Update cockpit-agama + - name: Update ${{ inputs.package_name }} run: osc service manualrun - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama + working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} - - name: Check cockpit-agama + - name: Check ${{ inputs.package_name }} run: osc status - working-directory: ./systemsmanagement:Agama:Staging/${{ vars.INPUT_PACKAGE_NAME }} + working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} - - name: Commit cockpit-agama + - name: Commit ${{ inputs.package_name }} run: |- osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama + working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 2a65d53dfa..9eff66655c 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -18,8 +18,6 @@ on: jobs: update_staging: - # do not run in forks - if: github.repository == 'openSUSE/agama' uses: ./.github/workflows/obs-staging-shared.yml # pass all secrets secrets: inherit From 54a07cfc0572ed6bda5900196d642aa4c16c4a8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 13:27:29 +0200 Subject: [PATCH 12/32] Added badges --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 9ff1f97512..ceb4b3c77e 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,9 @@ **[OBS systemsmanagement:Agama:Staging](https://build.opensuse.org/project/show/systemsmanagement:Agama:Staging)** [![OBS Staging (agama-cli)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-rust.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-rust.yml) +[![OBS:Staging (cockpit-agama)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-web.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-web.yml) +[![OBS:Staging (rubygem-agama)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-service.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-service.yml) +[![OBS:Staging (cockpit-agama-playwright)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-playwright.yml/badge.svg)](https://github.com/openSUSE/agama/actions/workflows/obs-staging-playwright.yml) # Agama: A Service-based Linux Installer From 5fe67442dd9e602b2472bc95443b1a2b5efa8a3c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 13:28:00 +0200 Subject: [PATCH 13/32] Share workflows --- .github/workflows/obs-staging-playwright.yml | 51 ++---------------- .github/workflows/obs-staging-rust.yml | 54 +++----------------- .github/workflows/obs-staging-web.yml | 1 - 3 files changed, 11 insertions(+), 95 deletions(-) diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index 55a41986e4..60209ddfc5 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -18,49 +18,8 @@ on: jobs: update_staging: - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends - cpio - obs-service-download_files - obs-service-format_spec_file - obs-service-obs_scm - osc - - - name: Configure osc - run: .github/workflows/configure_osc.sh - env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - - name: Checkout cockpit-agama-playwright - run: osc co systemsmanagement:Agama:Staging cockpit-agama-playwright - - - name: Update cockpit-agama-playwright - run: osc service manualrun - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright - - - name: Check cockpit-agama-playwright - run: osc status - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright - - - name: Commit cockpit-agama-playwright - run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" - working-directory: ./systemsmanagement:Agama:Staging/cockpit-agama-playwright + uses: ./.github/workflows/obs-staging-shared.yml + # pass all secrets + secrets: inherit + with: + package_name: cockpit-agama-playwright diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 6bbcbb67b8..081066c8da 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -18,51 +18,9 @@ on: jobs: update_staging: - # do not run in forks - if: github.repository == 'openSUSE/agama' - - runs-on: ubuntu-latest - - container: - image: registry.opensuse.org/opensuse/tumbleweed:latest - - steps: - - - name: Git Checkout - uses: actions/checkout@v3 - - - name: Configure and refresh repositories - # disable unused repositories to have a faster refresh - run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref - - - name: Install tools - run: zypper --non-interactive install --no-recommends - cpio - obs-service-cargo_audit - obs-service-cargo_vendor - obs-service-download_files - obs-service-format_spec_file - obs-service-obs_scm - osc - - - name: Configure osc - run: .github/workflows/configure_osc.sh - env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - - - name: Checkout agama-cli - run: osc co systemsmanagement:Agama:Staging agama-cli - - - name: Update agama-cli - run: osc service manualrun - working-directory: ./systemsmanagement:Agama:Staging/agama-cli - - - name: Check agama-cli - run: osc status - working-directory: ./systemsmanagement:Agama:Staging/agama-cli - - - name: Commit agama-cli - run: |- - osc commit -m "Updated to $(sed -e '/^version:/!d' -e 's/version: *\(.*\)/\1/' agama.obsinfo) ($(sed -e '/^commit:/!d' -e 's/commit: *\(.*\)/\1/' agama.obsinfo))" - working-directory: ./systemsmanagement:Agama:Staging/agama-cli + uses: ./.github/workflows/obs-staging-shared.yml + # pass all secrets + secrets: inherit + with: + install_packages: obs-service-cargo_audit obs-service-cargo_vendor + package_name: agama-cli diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 9eff66655c..987e83894d 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -24,4 +24,3 @@ jobs: with: install_packages: obs-service-node_modules package_name: cockpit-agama - From 3251e38488cec4c2b12af281fb08db816159423f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 13:41:19 +0200 Subject: [PATCH 14/32] inline osc configuration --- .github/workflows/obs-staging-service.yml | 5 +++-- .github/workflows/obs-staging-shared.yml | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index b8385b5cf3..8d6f8727e2 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -69,8 +69,9 @@ jobs: run: osc co systemsmanagement:Agama:Staging rubygem-agama - name: Update files - run: rm ./systemsmanagement:Agama:Staging/rubygem-agama/*; - cp service/agama-*.gem service/package/* ./systemsmanagement:Agama:Staging/rubygem-agama + run: |- + rm ./systemsmanagement:Agama:Staging/rubygem-agama/* + cp service/agama-*.gem service/package/* ./systemsmanagement:Agama:Staging/rubygem-agama - name: Check rubygem-agama run: osc addremove && osc status diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml index 4c04e72785..6ef91b5e03 100644 --- a/.github/workflows/obs-staging-shared.yml +++ b/.github/workflows/obs-staging-shared.yml @@ -30,9 +30,6 @@ jobs: image: registry.opensuse.org/opensuse/tumbleweed:latest steps: - - name: Git Checkout - uses: actions/checkout@v3 - - name: Configure and refresh repositories # disable unused repositories to have a faster refresh run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref @@ -47,10 +44,19 @@ jobs: ${{ inputs.install_packages }} - name: Configure osc - run: .github/workflows/configure_osc.sh + run: |- + CONFIG_FILE="$HOME/.config/osc/oscrc" + mkdir -p $(dirname "$CONFIG_FILE") + echo "$TEMPLATE" > "$CONFIG_FILE" env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + TEMPLATE: |- + [general] + apiurl = https://api.opensuse.org + + [https://api.opensuse.org] + user=${{ secrets.OBS_USER }} + pass=${{ secrets.OBS_PASSWORD }} + credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager - name: Checkout ${{ inputs.package_name }} run: osc co systemsmanagement:Agama:Staging ${{ inputs.package_name }} From 7872d26414346f727af54bbe5e82ac30c7cf80d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 13:49:19 +0200 Subject: [PATCH 15/32] Delete workflow scripts --- .github/workflows/configure_osc.sh | 15 --------------- .github/workflows/oscrc.template | 7 ------- 2 files changed, 22 deletions(-) delete mode 100755 .github/workflows/configure_osc.sh delete mode 100644 .github/workflows/oscrc.template diff --git a/.github/workflows/configure_osc.sh b/.github/workflows/configure_osc.sh deleted file mode 100755 index 193164b463..0000000000 --- a/.github/workflows/configure_osc.sh +++ /dev/null @@ -1,15 +0,0 @@ -#! /bin/bash - -# This helper script creates the "osc" configuration file with OBS credentials - -CONFIG_FILE="$HOME/.config/osc/oscrc" - -# do not overwrite the existing config accidentally -if [ -e "$CONFIG_FILE" ]; then - echo "ERROR: $CONFIG_FILE already exists" - exit 1 -fi - -TEMPLATE=$(dirname "${BASH_SOURCE[0]}")/oscrc.template -mkdir -p $(dirname "$CONFIG_FILE") -sed -e "s/@OBS_USER@/$OBS_USER/g" -e "s/@OBS_PASSWORD@/$OBS_PASSWORD/g" "$TEMPLATE" > "$CONFIG_FILE" diff --git a/.github/workflows/oscrc.template b/.github/workflows/oscrc.template deleted file mode 100644 index e6133a0677..0000000000 --- a/.github/workflows/oscrc.template +++ /dev/null @@ -1,7 +0,0 @@ -[general] -apiurl = https://api.opensuse.org - -[https://api.opensuse.org] -user=@OBS_USER@ -pass=@OBS_PASSWORD@ -credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager From d7e5231c5cf137f31c172bad715ceaa196e4ea22 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 15:19:50 +0200 Subject: [PATCH 16/32] Fixed updating rubygem-gama --- .github/workflows/obs-staging-playwright.yml | 3 --- .github/workflows/obs-staging-rust.yml | 3 --- .github/workflows/obs-staging-service.yml | 27 ++++++++++++++------ .github/workflows/obs-staging-shared.yml | 6 +++-- .github/workflows/obs-staging-web.yml | 3 --- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index 60209ddfc5..be4dcc0272 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -13,9 +13,6 @@ on: # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet # - playwright/** - # allows you to run this workflow manually from the Actions tab - workflow_dispatch: - jobs: update_staging: uses: ./.github/workflows/obs-staging-shared.yml diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 081066c8da..55029aed7c 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -13,9 +13,6 @@ on: # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet # - rust/** - # allows you to run this workflow manually from the Actions tab - workflow_dispatch: - jobs: update_staging: uses: ./.github/workflows/obs-staging-shared.yml diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 8d6f8727e2..7183c8ab83 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -13,9 +13,6 @@ on: # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet # - service/** - # allows you to run this workflow manually from the Actions tab - workflow_dispatch: - jobs: update_staging: # do not run in forks @@ -27,7 +24,6 @@ jobs: image: registry.opensuse.org/opensuse/tumbleweed:latest steps: - - name: Configure and refresh repositories # disable unused repositories to have a faster refresh run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref @@ -49,7 +45,13 @@ jobs: run: chown -R -c 0 . - name: Generate version number - run: git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > service/VERSION + # the version is .devel + # or just if there are no additional commits + run: |- + git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > VERSION + echo -n "Version: " + cat VERSION + working-directory: ./service - name: Update agma rubygem run: gem build agama.gemspec @@ -60,10 +62,19 @@ jobs: working-directory: ./service - name: Configure osc - run: .github/workflows/configure_osc.sh + run: |- + CONFIG_FILE="$HOME/.config/osc/oscrc" + mkdir -p $(dirname "$CONFIG_FILE") + echo "$TEMPLATE" > "$CONFIG_FILE" env: - OBS_USER: ${{ secrets.OBS_USER }} - OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} + TEMPLATE: |- + [general] + apiurl = https://api.opensuse.org + + [https://api.opensuse.org] + user=${{ secrets.OBS_USER }} + pass=${{ secrets.OBS_PASSWORD }} + credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager - name: Checkout rubygem-agama run: osc co systemsmanagement:Agama:Staging rubygem-agama diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml index 6ef91b5e03..cc26e06c95 100644 --- a/.github/workflows/obs-staging-shared.yml +++ b/.github/workflows/obs-staging-shared.yml @@ -1,3 +1,5 @@ +# this is a shared workflow, not called as a top level workflow + name: Update OBS Staging on: @@ -61,11 +63,11 @@ jobs: - name: Checkout ${{ inputs.package_name }} run: osc co systemsmanagement:Agama:Staging ${{ inputs.package_name }} - - name: Update ${{ inputs.package_name }} + - name: Run services run: osc service manualrun working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} - - name: Check ${{ inputs.package_name }} + - name: Check status run: osc status working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index 987e83894d..f8d0c2a149 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -13,9 +13,6 @@ on: # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet # - web/** - # allows you to run this workflow manually from the Actions tab - workflow_dispatch: - jobs: update_staging: uses: ./.github/workflows/obs-staging-shared.yml From 5bfd9dd41311062425c2e87a08ef8f346f4f5121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 16:42:01 +0200 Subject: [PATCH 17/32] Generate the gem version --- .github/workflows/obs-staging-service.yml | 36 +++-------------------- Rakefile | 2 +- service/.gitignore | 2 ++ service/VERSION | 1 - service/agama.gemspec | 4 ++- 5 files changed, 10 insertions(+), 35 deletions(-) delete mode 100644 service/VERSION diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 7183c8ab83..b4429f6240 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -42,25 +42,9 @@ jobs: fetch-depth: 0 - name: Fix file owner + # workaround for a strict git check run: chown -R -c 0 . - - name: Generate version number - # the version is .devel - # or just if there are no additional commits - run: |- - git describe --tags | sed -e 's/-\([0-9]*\)-g[a-fA-F0-9]*$/.devel\1/' -e 's/^v//' > VERSION - echo -n "Version: " - cat VERSION - working-directory: ./service - - - name: Update agma rubygem - run: gem build agama.gemspec - working-directory: ./service - - - name: Generate RPM spec file - run: gem2rpm --local --config package/gem2rpm.yml agama-*.gem > package/rubygem-agama.spec - working-directory: ./service - - name: Configure osc run: |- CONFIG_FILE="$HOME/.config/osc/oscrc" @@ -76,18 +60,6 @@ jobs: pass=${{ secrets.OBS_PASSWORD }} credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager - - name: Checkout rubygem-agama - run: osc co systemsmanagement:Agama:Staging rubygem-agama - - - name: Update files - run: |- - rm ./systemsmanagement:Agama:Staging/rubygem-agama/* - cp service/agama-*.gem service/package/* ./systemsmanagement:Agama:Staging/rubygem-agama - - - name: Check rubygem-agama - run: osc addremove && osc status - working-directory: ./systemsmanagement:Agama:Staging/rubygem-agama - - - name: Commit rubygem-agama - run: osc commit -m "Updating to $(cat ../../service/VERSION) ($GITHUB_SHA)" - working-directory: ./systemsmanagement:Agama:Staging/rubygem-agama + - name: Build the package + run: rake osc:commit + working-directory: ./service diff --git a/Rakefile b/Rakefile index f8e358c1f0..6c962d68f0 100644 --- a/Rakefile +++ b/Rakefile @@ -87,7 +87,7 @@ task package: [] do sh "gem build #{name}.gemspec" gem = find_gem(dir).first gem2rpm = File.join(package_dir, "gem2rpm.yml") - sh "gem2rpm --config #{gem2rpm} --template opensuse #{gem} > package/#{package_name}.spec" + sh "gem2rpm --local --config #{gem2rpm} --template opensuse #{gem} > package/#{package_name}.spec" FileUtils.mv(gem, package_dir) end end diff --git a/service/.gitignore b/service/.gitignore index e3200e0f81..ec66c82d0a 100644 --- a/service/.gitignore +++ b/service/.gitignore @@ -1,4 +1,6 @@ *.gem +# the spec file is generated +/package/*.spec *.rbc /.config /coverage/ diff --git a/service/VERSION b/service/VERSION deleted file mode 100644 index 879b416e60..0000000000 --- a/service/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.1 diff --git a/service/agama.gemspec b/service/agama.gemspec index d8fe294a7c..844a06cccf 100644 --- a/service/agama.gemspec +++ b/service/agama.gemspec @@ -22,7 +22,9 @@ Gem::Specification.new do |spec| spec.name = "agama" - spec.version = File.read("VERSION").chomp + # the version is .devel + # or just if there are no additional commits + spec.version = `git describe --tags`.chomp.sub(/^v/, "").sub(/-([0-9]+)-g\h+\Z/, ".devel\\1") spec.summary = "Agama Installer Service" spec.description = "System service for Agama, an experimental YaST-based installer." spec.author = "YaST Team" From 3dd3a6d90d50125322286466fe0b4f3fcbc1a810 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:06:05 +0200 Subject: [PATCH 18/32] Install yast-rake --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index b4429f6240..97275c7acb 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -34,6 +34,7 @@ jobs: osc ruby 'rubygem(gem2rpm)' + 'rubygem(yast-rake)' - name: Git Checkout uses: actions/checkout@v3 From 1a34416c4b985c582251a563d13efdd2391ce737 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:11:14 +0200 Subject: [PATCH 19/32] Install build --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 97275c7acb..f71715e121 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -30,6 +30,7 @@ jobs: - name: Install tools run: zypper --non-interactive install --no-recommends + build git osc ruby From 029ec01dca6bd3ffdd074347de9290c878bf57c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:14:20 +0200 Subject: [PATCH 20/32] Trust project --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index f71715e121..21d1e7789d 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -61,6 +61,7 @@ jobs: user=${{ secrets.OBS_USER }} pass=${{ secrets.OBS_PASSWORD }} credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager + trusted_prj=openSUSE:Factory - name: Build the package run: rake osc:commit From a65e547b190de54b0a8d47ce198f4e64961f0e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:19:14 +0200 Subject: [PATCH 21/32] Trust project --- .github/workflows/obs-staging-service.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 21d1e7789d..9752a4bdeb 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -61,7 +61,7 @@ jobs: user=${{ secrets.OBS_USER }} pass=${{ secrets.OBS_PASSWORD }} credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager - trusted_prj=openSUSE:Factory + trusted_prj=openSUSE:Factory openSUSE:Tumbleweed - name: Build the package run: rake osc:commit From ba69735bcab72926adca184c950bdcfb396becc9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:23:10 +0200 Subject: [PATCH 22/32] Install sudo --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 9752a4bdeb..1790869777 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -36,6 +36,7 @@ jobs: ruby 'rubygem(gem2rpm)' 'rubygem(yast-rake)' + sudo - name: Git Checkout uses: actions/checkout@v3 From 68fb77758765b5672579487784291601422a9223 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:31:17 +0200 Subject: [PATCH 23/32] Privileged container --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 1790869777..4c0339236e 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -22,6 +22,7 @@ jobs: container: image: registry.opensuse.org/opensuse/tumbleweed:latest + options: --privileged steps: - name: Configure and refresh repositories From d7b4611df1df8eb34c585556ef0b2ff2404daef0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 17:36:51 +0200 Subject: [PATCH 24/32] Install obs-service-format_spec_file --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 4c0339236e..6d2b0facab 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -33,6 +33,7 @@ jobs: run: zypper --non-interactive install --no-recommends build git + obs-service-format_spec_file osc ruby 'rubygem(gem2rpm)' From 3e65fc00cfb81df4c9a8c3440ba5e7e3a2aa3043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 18:04:09 +0200 Subject: [PATCH 25/32] Skip package build --- .github/workflows/obs-staging-service.yml | 9 +++------ Rakefile | 5 ++++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 6d2b0facab..35cc4cdb96 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -22,7 +22,6 @@ jobs: container: image: registry.opensuse.org/opensuse/tumbleweed:latest - options: --privileged steps: - name: Configure and refresh repositories @@ -31,14 +30,11 @@ jobs: - name: Install tools run: zypper --non-interactive install --no-recommends - build git - obs-service-format_spec_file osc ruby 'rubygem(gem2rpm)' 'rubygem(yast-rake)' - sudo - name: Git Checkout uses: actions/checkout@v3 @@ -64,8 +60,9 @@ jobs: user=${{ secrets.OBS_USER }} pass=${{ secrets.OBS_PASSWORD }} credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager - trusted_prj=openSUSE:Factory openSUSE:Tumbleweed - - name: Build the package + - name: Commit the rubygem-agama package run: rake osc:commit working-directory: ./service + env: + SKIP_OSC_BUILD: 1 diff --git a/Rakefile b/Rakefile index 6c962d68f0..f2fdef496e 100644 --- a/Rakefile +++ b/Rakefile @@ -74,8 +74,11 @@ end # Removes the "package" task to redefine it later. Rake::Task["package"].clear + # Disables the osc:build -# Rake::Task["osc:build"].clear +if ENV["SKIP_OSC_BUILD"] == "1" + Rake::Task["osc:build"].clear +end # TODO: redefine :tarball instead of :package desc "Prepare sources for rpm build" From 594e444b0d000a3644dc3871c5751bd1fdf05837 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Wed, 7 Jun 2023 18:06:08 +0200 Subject: [PATCH 26/32] Install obs-service-format_spec_file --- .github/workflows/obs-staging-service.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 35cc4cdb96..0ecd0c31e7 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -31,6 +31,7 @@ jobs: - name: Install tools run: zypper --non-interactive install --no-recommends git + obs-service-format_spec_file osc ruby 'rubygem(gem2rpm)' From 44b5181d26c8470b975bf23a299c871fbc310237 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 09:46:42 +0200 Subject: [PATCH 27/32] Revert "Delete workflow scripts" This reverts commit 7872d26414346f727af54bbe5e82ac30c7cf80d1. --- .github/workflows/configure_osc.sh | 15 +++++++++++++++ .github/workflows/oscrc.template | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100755 .github/workflows/configure_osc.sh create mode 100644 .github/workflows/oscrc.template diff --git a/.github/workflows/configure_osc.sh b/.github/workflows/configure_osc.sh new file mode 100755 index 0000000000..193164b463 --- /dev/null +++ b/.github/workflows/configure_osc.sh @@ -0,0 +1,15 @@ +#! /bin/bash + +# This helper script creates the "osc" configuration file with OBS credentials + +CONFIG_FILE="$HOME/.config/osc/oscrc" + +# do not overwrite the existing config accidentally +if [ -e "$CONFIG_FILE" ]; then + echo "ERROR: $CONFIG_FILE already exists" + exit 1 +fi + +TEMPLATE=$(dirname "${BASH_SOURCE[0]}")/oscrc.template +mkdir -p $(dirname "$CONFIG_FILE") +sed -e "s/@OBS_USER@/$OBS_USER/g" -e "s/@OBS_PASSWORD@/$OBS_PASSWORD/g" "$TEMPLATE" > "$CONFIG_FILE" diff --git a/.github/workflows/oscrc.template b/.github/workflows/oscrc.template new file mode 100644 index 0000000000..e6133a0677 --- /dev/null +++ b/.github/workflows/oscrc.template @@ -0,0 +1,7 @@ +[general] +apiurl = https://api.opensuse.org + +[https://api.opensuse.org] +user=@OBS_USER@ +pass=@OBS_PASSWORD@ +credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager From e7b04e27ab25288cfd09a21e770cabb0f80b41c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 09:49:56 +0200 Subject: [PATCH 28/32] Configure osc using a script --- .github/workflows/obs-staging-service.yml | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 0ecd0c31e7..ab4cb401bd 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -48,19 +48,10 @@ jobs: run: chown -R -c 0 . - name: Configure osc - run: |- - CONFIG_FILE="$HOME/.config/osc/oscrc" - mkdir -p $(dirname "$CONFIG_FILE") - echo "$TEMPLATE" > "$CONFIG_FILE" + run: .github/workflows/configure_osc.sh env: - TEMPLATE: |- - [general] - apiurl = https://api.opensuse.org - - [https://api.opensuse.org] - user=${{ secrets.OBS_USER }} - pass=${{ secrets.OBS_PASSWORD }} - credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - name: Commit the rubygem-agama package run: rake osc:commit From 56a8a835c1f574ba023d12c2635e6767c5d4c61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 09:56:56 +0200 Subject: [PATCH 29/32] use shared script --- .github/workflows/obs-staging-shared.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/obs-staging-shared.yml b/.github/workflows/obs-staging-shared.yml index cc26e06c95..cd42f63f0e 100644 --- a/.github/workflows/obs-staging-shared.yml +++ b/.github/workflows/obs-staging-shared.yml @@ -32,6 +32,9 @@ jobs: image: registry.opensuse.org/opensuse/tumbleweed:latest steps: + - name: Git Checkout + uses: actions/checkout@v3 + - name: Configure and refresh repositories # disable unused repositories to have a faster refresh run: zypper modifyrepo -d repo-non-oss repo-openh264 repo-update && zypper ref @@ -46,19 +49,10 @@ jobs: ${{ inputs.install_packages }} - name: Configure osc - run: |- - CONFIG_FILE="$HOME/.config/osc/oscrc" - mkdir -p $(dirname "$CONFIG_FILE") - echo "$TEMPLATE" > "$CONFIG_FILE" + run: .github/workflows/configure_osc.sh env: - TEMPLATE: |- - [general] - apiurl = https://api.opensuse.org - - [https://api.opensuse.org] - user=${{ secrets.OBS_USER }} - pass=${{ secrets.OBS_PASSWORD }} - credentials_mgr_class=osc.credentials.PlaintextConfigFileCredentialsManager + OBS_USER: ${{ secrets.OBS_USER }} + OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} - name: Checkout ${{ inputs.package_name }} run: osc co systemsmanagement:Agama:Staging ${{ inputs.package_name }} From ec2b620008e0bd9f295b42efbf6e590c08679761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 14:37:23 +0200 Subject: [PATCH 30/32] Added documentation --- .github/workflows/obs-staging-service.yml | 2 + doc/obs_integration.md | 78 +++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 doc/obs_integration.md diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index ab4cb401bd..2436c1108c 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -57,4 +57,6 @@ jobs: run: rake osc:commit working-directory: ./service env: + # do not build the package with "osc", it takes long time + # and does not provide much value SKIP_OSC_BUILD: 1 diff --git a/doc/obs_integration.md b/doc/obs_integration.md new file mode 100644 index 0000000000..1b9a108117 --- /dev/null +++ b/doc/obs_integration.md @@ -0,0 +1,78 @@ +# The Open Build Service (OBS) Integration + +The Agama installer packages are built in the openSUSE [Open Build Service]( +https://build.opensuse.org/). + +## Staging Project + +The [systemsmanagement:Agama:Staging](https://build.opensuse.org/project/show/systemsmanagement:Agama:Staging) +contains the latest packages built from the `master` Git branch. This project +contains unstable development version of Agama. It is intended for development +and testing. + +The packages are automatically updated whenever the `master` branch is changed, +see more details below. + +## Development Project + +The [systemsmanagement:Agama:Devel](https://build.opensuse.org/project/show/systemsmanagement:Agama:Devel) +contains the latest released version of the Agama project. The packages should +be more stable than in the Staging project. + +These packages are updated manually when a new version is released. + +## OBS Synchronization + +The automatic OBS synchronization is implemented using the [GitHub Actions]( +https://github.com/features/actions). The actions are defined in the +`obs-staging-*.yml` files in the [.github/workflows](../.github/workflows) +directory. + +Because the process of updating a package is the same for several packages +the definition is shared in the [obs-staging-shared.yml]( +../.github/workflows/obs-staging-shared.yml) file. + +### Details + +The packages in OBS are updated by running the OBS service which downloads the +sources from GitHub and dependencies from other repositories (Rust or NPM +packages). + +The process of updating a package is basically: + +- `osc co systemsmanagement:Agama:Staging ` - checkout the package + from OBS +- `osc service manualrun` - update the sources and dependencies by running + the OBS services locally +- `osc commit` - upload the changes to the OBS server, it will rebuild the + updated package automatically + +To run the services locally you need to install the OSC tool and several +packages with the used OBS services: + +```shell +zypper install osc obs-service-cargo_audit obs-service-cargo_vendor \ + obs-service-download_files obs-service-format_spec_file obs-service-obs_scm \ + obs-service-node_modules +``` + +The `rubygem-agama` package uses a different approach because the Ruby packages +use `*.gem` files which are not supported by OBS services. It uses the +[osc:commit](https://github.com/openSUSE/packaging_rake_tasks#osccommit) Rake +task, same as the YaST packages. + +### Package Versioning + +### Staging + +The packages in the Staging project use a version built from the last released +version with a number of commits in the `master` branch since that release. + +The version is automatically constructed by the OBS service, for the +`rubygem-agama` package the version is built using the `git describe --tags` +command. + +### Devel + +The Devel packages use the release version (a Git tag) without any additional +number of commits. From 7e60c7bb93e583b0dec03a7317c02c36cae92a9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 14:39:34 +0200 Subject: [PATCH 31/32] Prepare for merge to master --- .github/workflows/obs-staging-playwright.yml | 10 +++------- .github/workflows/obs-staging-rust.yml | 10 +++------- .github/workflows/obs-staging-service.yml | 10 +++------- .github/workflows/obs-staging-web.yml | 10 +++------- 4 files changed, 12 insertions(+), 28 deletions(-) diff --git a/.github/workflows/obs-staging-playwright.yml b/.github/workflows/obs-staging-playwright.yml index be4dcc0272..df512db08a 100644 --- a/.github/workflows/obs-staging-playwright.yml +++ b/.github/workflows/obs-staging-playwright.yml @@ -5,13 +5,9 @@ on: push: branches: - master - # FIXME: remove this before merging - - obs_sync - # FIXME: enable before merging - # paths: - # # run only when a Playwright source is changed - # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - # - playwright/** + paths: + # run only when a Playwright source is changed + - playwright/** jobs: update_staging: diff --git a/.github/workflows/obs-staging-rust.yml b/.github/workflows/obs-staging-rust.yml index 55029aed7c..4ef178612d 100644 --- a/.github/workflows/obs-staging-rust.yml +++ b/.github/workflows/obs-staging-rust.yml @@ -5,13 +5,9 @@ on: push: branches: - master - # FIXME: remove this before merging - - obs_sync - # FIXME: enable before merging - # paths: - # # run only when a Rust source is changed - # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - # - rust/** + paths: + # run only when a Rust source is changed + - rust/** jobs: update_staging: diff --git a/.github/workflows/obs-staging-service.yml b/.github/workflows/obs-staging-service.yml index 2436c1108c..c2b39e219a 100644 --- a/.github/workflows/obs-staging-service.yml +++ b/.github/workflows/obs-staging-service.yml @@ -5,13 +5,9 @@ on: push: branches: - master - # FIXME: remove this before merging - - obs_sync - # FIXME: enable before merging - # paths: - # # run only when a service source is changed - # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - # - service/** + paths: + # run only when a service source is changed + - service/** jobs: update_staging: diff --git a/.github/workflows/obs-staging-web.yml b/.github/workflows/obs-staging-web.yml index f8d0c2a149..e795e70310 100644 --- a/.github/workflows/obs-staging-web.yml +++ b/.github/workflows/obs-staging-web.yml @@ -5,13 +5,9 @@ on: push: branches: - master - # FIXME: remove this before merging - - obs_sync - # FIXME: enable before merging - # paths: - # # run only when a web frontend source is changed - # # https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet - # - web/** + paths: + # run only when a web frontend source is changed + - web/** jobs: update_staging: From 85b4fd7a18ac3d8e9725fb445ffe8aafeee71eec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Thu, 8 Jun 2023 15:02:43 +0200 Subject: [PATCH 32/32] Update README --- doc/obs_integration.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/obs_integration.md b/doc/obs_integration.md index 1b9a108117..31b76e5501 100644 --- a/doc/obs_integration.md +++ b/doc/obs_integration.md @@ -32,6 +32,10 @@ Because the process of updating a package is the same for several packages the definition is shared in the [obs-staging-shared.yml]( ../.github/workflows/obs-staging-shared.yml) file. +The packages in staging are updated only when a respective source file is +changed. That saves some resources for rebuilding and makes synchronization +faster. But that also means the packages might not have exactly same version. + ### Details The packages in OBS are updated by running the OBS service which downloads the