Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/ci-devel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI - Devel scripts

on:
push:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used below for the pull request event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-devel.yml
# any change in the devel subfolder
- devel/**
# except the Markdown documentation
- "!devel/**.md"
pull_request:
paths:
# NOTE: GitHub Actions do not allow using YAML references, the same path
# list is used above for the push event. Keep both lists in sync!!

# this file as well
- .github/workflows/ci-devel.yml
# any change in the devel subfolder
- devel/**
# except the Markdown documentation
- "!devel/**.md"

# allow running manually
workflow_dispatch:

jobs:
ci_devel:
runs-on: ubuntu-latest

steps:

- name: Git Checkout
uses: actions/checkout@v4
with:
# checkout only the "devel" subdirectory
sparse-checkout: |
devel

- name: Run the tests
run: find devel -type f -exec grep -l -E "^#! *(/usr/|)/bin/(ba|)sh" \{\} \; | xargs -I% bash -c "echo 'Checking %...' && shellcheck %"
48 changes: 0 additions & 48 deletions .github/workflows/obs-release.yml

This file was deleted.

37 changes: 17 additions & 20 deletions .github/workflows/obs-service-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,24 @@ name: Update OBS Service Package
on:
workflow_call:
secrets:
OBS_USER:
required: true
OBS_PASSWORD:
required: true

jobs:
update_service:
# do not run in forks which do not set the OBS_PROJECT variable
if: vars.OBS_PROJECT != ''
# do not run in forks which do not set the OBS_PROJECTS and OBS_USER variables,
# or the mapping for the current branch is missing
if: vars.OBS_PROJECTS && fromJson(vars.OBS_PROJECTS)[github.ref_name] && vars.OBS_USER

runs-on: ubuntu-latest

container:
image: registry.opensuse.org/opensuse/tumbleweed:latest

env:
# to avoid Ruby UTF-8 errors (the default is "POSIX")
LC_ALL: en_US.UTF-8

steps:
- name: Configure and refresh repositories
# disable unused repositories to have a faster refresh
Expand All @@ -43,33 +46,27 @@ jobs:
# fetch all history, we need to find the latest tag and offset for the version number
fetch-depth: 0

- name: Git Checkout (release tag only)
if: ${{ github.ref_type == 'tag' }}
uses: actions/checkout@v4

- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Git Checkout
uses: actions/checkout@v4
with:
# fetch all history with tags, we need to find the latest version tag
fetch-depth: 0
fetch-tags: true

- name: Configure osc
run: .github/workflows/configure_osc.sh
env:
OBS_USER: ${{ secrets.OBS_USER }}
OBS_USER: ${{ vars.OBS_USER }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}

- name: Commit the rubygem-agama-yast package to ${{ vars.OBS_PROJECT }}
- name: Commit the rubygem-agama-yast package to ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}
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
OBS_PROJECT: ${{ vars.OBS_PROJECT }}

- name: Submit the rubygem-agama-yast package
# only when a tag has been pushed
if: ${{ github.ref_type == 'tag' }}
# the package has been comitted in the previous step, just submit it
run: rake osc:sr:force
working-directory: ./service
env:
OBS_PROJECT: ${{ vars.OBS_PROJECT }}
OBS_PROJECT: ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}
3 changes: 0 additions & 3 deletions .github/workflows/obs-staging-autoinstallation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: Submit agama-auto
on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when an autoinstallation source is changed
- autoinstallation/**
Expand Down
19 changes: 8 additions & 11 deletions .github/workflows/obs-staging-live.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Submit agama-installer

on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when a live ISO source is changed
- live/**
Expand All @@ -14,9 +10,10 @@ on:
workflow_dispatch:

jobs:
update_staging_package:
# do not run in forks which do not set the OBS_PROJECT variable
if: vars.OBS_PROJECT != ''
update_obs_package:
# do not run in forks which do not set the OBS_PROJECTS variable,
# or the mapping for the current branch is missing
if: vars.OBS_PROJECTS && fromJson(vars.OBS_PROJECTS)[github.ref_name] && vars.OBS_USER

runs-on: ubuntu-latest

Expand All @@ -41,11 +38,11 @@ jobs:
- name: Configure osc
run: .github/workflows/configure_osc.sh
env:
OBS_USER: ${{ secrets.OBS_USER }}
OBS_USER: ${{ vars.OBS_USER }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}

- name: Checkout ${{ vars.OBS_PROJECT }} agama-installer
run: osc co -o dist ${{ vars.OBS_PROJECT }} agama-installer
- name: Checkout ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }} agama-installer
run: osc co -o dist ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }} agama-installer
working-directory: ./live

- name: Build sources
Expand All @@ -60,6 +57,6 @@ jobs:
run: osc diff && osc status
working-directory: ./live/dist

- name: Commit agama-installer to ${{ vars.OBS_PROJECT }}
- name: Commit agama-installer to ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}
run: osc commit -m "Updated to Agama $GITHUB_SHA"
working-directory: ./live/dist
6 changes: 1 addition & 5 deletions .github/workflows/obs-staging-products.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
name: Submit agama-products

on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when a Rust source is changed
# run only when a product source is changed
- products.d/**

# allow running manually
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/obs-staging-rust.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Submit agama

on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when a Rust source is changed
- rust/**
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/obs-staging-service.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Submit rubygem-agama-yast

on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when a service source is changed
- service/**
Expand Down
64 changes: 21 additions & 43 deletions .github/workflows/obs-staging-shared.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ name: Update OBS Packages
on:
workflow_call:
secrets:
OBS_USER:
required: true
OBS_PASSWORD:
required: true

Expand All @@ -27,28 +25,17 @@ on:
type: string

jobs:
update_staging_package:
# do not run in forks which do not set the OBS_PROJECT variable,
# for the "release" branch or a git tag use the OBS_PROJECT_RELEASE variable
if: vars.OBS_PROJECT != '' || ((github.ref_name == 'release' || github.ref_type == 'tag') && vars.OBS_PROJECT_RELEASE != '')
update_obs_package:
# do not run in forks which do not set the OBS_PROJECTS and OBS_USER variables,
# or the mapping for the current branch is missing
if: vars.OBS_PROJECTS && fromJson(vars.OBS_PROJECTS)[github.ref_name] && vars.OBS_USER

runs-on: ubuntu-latest

container:
image: registry.opensuse.org/opensuse/tumbleweed:latest

steps:
- name: Select OBS project
id: obs_project
run: |-
if [ "${{ github.ref_name }}" = "release" -o "${{ github.ref_type }}" = "tag" ]; then
echo "OBS_PROJECT=${{ vars.OBS_PROJECT_RELEASE }}" >> "$GITHUB_OUTPUT"
echo "OBS project: ${{ vars.OBS_PROJECT_RELEASE }}"
else
echo "OBS_PROJECT=${{ vars.OBS_PROJECT }}" >> "$GITHUB_OUTPUT"
echo "OBS project: ${{ vars.OBS_PROJECT }}"
fi

- 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
Expand All @@ -73,54 +60,45 @@ jobs:
- name: Configure osc
run: .github/workflows/configure_osc.sh
env:
OBS_USER: ${{ secrets.OBS_USER }}
OBS_USER: ${{ vars.OBS_USER }}
OBS_PASSWORD: ${{ secrets.OBS_PASSWORD }}

- name: Checkout ${{ steps.obs_project.outputs.OBS_PROJECT }} ${{ inputs.package_name }}
run: osc co ${{ steps.obs_project.outputs.OBS_PROJECT }} ${{ inputs.package_name }}
- name: Checkout ${{ inputs.package_name }} from ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}
run: osc co ${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }} ${{ inputs.package_name }}

- name: Configure git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"

- name: Update service revision
# only when a tag has been pushed, or "release" branch updated
if: github.ref_type == 'tag' || github.ref_name == 'release'
if: inputs.service_file != ''
run: |-
echo "Updating revision to \"${{ github.ref_name }}\""
sed -i -e 's#<param name="revision">.*</param>#<param name="revision">${{ github.ref_name }}</param>#' _service
working-directory: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}
sed -i -e 's#<param name="revision">.*</param>#<param name="revision">${{ github.ref_name }}</param>#' ${{ inputs.service_file }}

- name: Copy optional service file
# patch the URL in the file so it works also from forks, forks also by
# default do not inherit the tags so remove the version format option if
# no tag is present
if: inputs.service_file != ''
run: |
sed -e 's#<param name="url">.*</param>#<param name="url">https://github.com/${{ github.repository }}.git</param>#' ${{ inputs.service_file }} > ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}/_service
if [ -z "$(git tag -l)" ]; then sed -i -e 's#<param name="versionformat">.*</param>##' ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}/_service; fi
sed -e 's#<param name="url">.*</param>#<param name="url">https://github.com/${{ github.repository }}.git</param>#' ${{ inputs.service_file }} > ./${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}/${{ inputs.package_name }}/_service
if [ -z "$(git tag -l)" ]; then sed -i -e 's#<param name="versionformat">.*</param>##' ./${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}/${{ inputs.package_name }}/_service; fi

- name: Run services
run: osc service manualrun
working-directory: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}

- name: Cleanup
# sometimes the "osc service" run does not cleanup properly all
# downloaded NPM package tarballs and they are accidentally added to the
# OBS package, so delete any TGZ files present
run: rm -vf *.tgz
working-directory: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}
run: |
osc service manualrun
# sometimes the "osc service" run does not cleanup properly all
# downloaded NPM package tarballs and they are accidentally added to the
# OBS package, so delete any TGZ files present
rm -vf *.tgz
working-directory: ./${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}/${{ inputs.package_name }}

- name: Check status
run: osc addremove && osc diff && osc status
working-directory: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}
working-directory: ./${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}/${{ inputs.package_name }}

- name: Commit ${{ inputs.package_name }} to ${{ steps.obs_project.outputs.OBS_PROJECT }}
- name: Commit ${{ inputs.package_name }} to ${{ fromJson(vars.OBS_PROJECTS)[github.ref_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: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}

- name: Submit the package
# only when a tag has been pushed
if: github.ref_type == 'tag'
run: osc sr --yes -m "Releasing version ${{ github.ref_name }}"
working-directory: ./${{ steps.obs_project.outputs.OBS_PROJECT }}/${{ inputs.package_name }}
working-directory: ./${{ fromJson(vars.OBS_PROJECTS)[github.ref_name] }}/${{ inputs.package_name }}
4 changes: 0 additions & 4 deletions .github/workflows/obs-staging-web.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
name: Submit agama-web-ui

on:
# runs on pushes targeting the default branch
push:
branches:
- master
- release
paths:
# run only when a web frontend source is changed
- web/**
Expand Down
Loading