-
Notifications
You must be signed in to change notification settings - Fork 74
GitHub Actions: update systemsmanagement:Agama:Staging in OBS #606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
f42a7f9
GitHub Actions: update systemsmanagement:Agama:Staging/agama-cli in OBS
lslezak e8a7e5e
Update playwright test package
lslezak 5a028e4
Update cockpit-agama package
lslezak 7f9f130
Update rubygem-agama package
lslezak 2d045b1
Fixed cloning
lslezak 9d01210
Fix file owener
lslezak 4c8f9b8
Better commit message
lslezak 2acd243
Even better commit message :smiley:
lslezak d65617f
Try using a shared workflow
lslezak 24bd453
input test
lslezak d2aa129
Use inputs
lslezak 54a07cf
Added badges
lslezak 5fe6744
Share workflows
lslezak 3251e38
inline osc configuration
lslezak 7872d26
Delete workflow scripts
lslezak d7e5231
Fixed updating rubygem-gama
lslezak 5bfd9dd
Generate the gem version
lslezak 3dd3a6d
Install yast-rake
lslezak 1a34416
Install build
lslezak 029ec01
Trust project
lslezak a65e547
Trust project
lslezak ba69735
Install sudo
lslezak 68fb777
Privileged container
lslezak d7b4611
Install obs-service-format_spec_file
lslezak 3e65fc0
Skip package build
lslezak 594e444
Install obs-service-format_spec_file
lslezak 44b5181
Revert "Delete workflow scripts"
lslezak e7b04e2
Configure osc using a script
lslezak 56a8a83
use shared script
lslezak ec2b620
Added documentation
lslezak 7e60c7b
Prepare for merge to master
lslezak 85b4fd7
Update README
lslezak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| name: OBS:Staging (cockpit-agama-playwright) | ||
|
|
||
| on: | ||
| # runs on pushes targeting the default branch | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| # run only when a Playwright source is changed | ||
| - playwright/** | ||
|
|
||
| jobs: | ||
| update_staging: | ||
| uses: ./.github/workflows/obs-staging-shared.yml | ||
| # pass all secrets | ||
| secrets: inherit | ||
| with: | ||
| package_name: cockpit-agama-playwright |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: OBS:Staging (agama-cli) | ||
|
|
||
| on: | ||
| # runs on pushes targeting the default branch | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| # run only when a Rust source is changed | ||
| - rust/** | ||
|
|
||
| jobs: | ||
| update_staging: | ||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| name: OBS:Staging (rubygem-agama) | ||
|
|
||
| on: | ||
| # runs on pushes targeting the default branch | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| # run only when a service source is changed | ||
| - service/** | ||
|
|
||
| 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: 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 | ||
| obs-service-format_spec_file | ||
| osc | ||
| ruby | ||
| 'rubygem(gem2rpm)' | ||
| 'rubygem(yast-rake)' | ||
|
|
||
| - 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: Fix file owner | ||
| # workaround for a strict git check | ||
| run: chown -R -c 0 . | ||
|
|
||
| - name: Configure osc | ||
| run: .github/workflows/configure_osc.sh | ||
| env: | ||
| OBS_USER: ${{ secrets.OBS_USER }} | ||
| OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} | ||
|
|
||
| - name: Commit the rubygem-agama package | ||
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # this is a shared workflow, not called as a top level workflow | ||
|
|
||
| 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: | ||
| # 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 | ||
| ${{ inputs.install_packages }} | ||
|
|
||
| - name: Configure osc | ||
| run: .github/workflows/configure_osc.sh | ||
| env: | ||
| OBS_USER: ${{ secrets.OBS_USER }} | ||
| OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }} | ||
|
|
||
| - name: Checkout ${{ inputs.package_name }} | ||
| run: osc co systemsmanagement:Agama:Staging ${{ inputs.package_name }} | ||
|
|
||
| - name: Run services | ||
| run: osc service manualrun | ||
| working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} | ||
|
|
||
| - name: Check status | ||
| run: osc status | ||
| working-directory: ./systemsmanagement:Agama:Staging/${{ inputs.package_name }} | ||
|
|
||
| - 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/${{ inputs.package_name }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| name: OBS:Staging (cockpit-agama) | ||
|
|
||
| on: | ||
| # runs on pushes targeting the default branch | ||
| push: | ||
| branches: | ||
| - master | ||
| paths: | ||
| # run only when a web frontend source is changed | ||
| - web/** | ||
|
|
||
| jobs: | ||
| update_staging: | ||
| uses: ./.github/workflows/obs-staging-shared.yml | ||
| # pass all secrets | ||
| secrets: inherit | ||
| with: | ||
| install_packages: obs-service-node_modules | ||
| package_name: cockpit-agama |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # 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. | ||
|
|
||
| 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 | ||
| 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 <package>` - 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| *.gem | ||
| # the spec file is generated | ||
| /package/*.spec | ||
| *.rbc | ||
| /.config | ||
| /coverage/ | ||
|
|
||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,9 @@ | |
|
|
||
| Gem::Specification.new do |spec| | ||
| spec.name = "agama" | ||
| spec.version = File.read("VERSION").chomp | ||
| # the version is <version_tag>.devel<number_of_commits_since_the_tag> | ||
| # or just <version_tag> if there are no additional commits | ||
| spec.version = `git describe --tags`.chomp.sub(/^v/, "").sub(/-([0-9]+)-g\h+\Z/, ".devel\\1") | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍 |
||
| spec.summary = "Agama Installer Service" | ||
| spec.description = "System service for Agama, an experimental YaST-based installer." | ||
| spec.author = "YaST Team" | ||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we here also force only master branch?