diff --git a/.gitea/workflows/obs-service.yaml b/.gitea/workflows/obs-service.yaml index ce09261..bb0c204 100644 --- a/.gitea/workflows/obs-service.yaml +++ b/.gitea/workflows/obs-service.yaml @@ -8,12 +8,21 @@ jobs: runs-on: ubuntu-latest name: opensuse osc custom container checkout test steps: - - name: Build action step + - name: Get OBS Buildlog step uses: https://src.opensuse.org/alexlau/bc@v4 with: osc_user: 'alexlau' osc_path: 'home:alexlau:branches:Base:System' osc_package: 'bc' + osc_action: 'buildlog' + env: # Or as an environment variable + osc_pass: ${{ secrets.OSCPASS }} + - name: Run a local build step + uses: https://src.opensuse.org/alexlau/bc@v4 + with: + osc_user: 'alexlau' + osc_path: 'home:alexlau:branches:Base:System' + osc_package: 'bc' + osc_action: 'build' env: # Or as an environment variable osc_pass: ${{ secrets.OSCPASS }} - id: osc-demo diff --git a/action.yml b/action.yml index 423266a..5cdb871 100644 --- a/action.yml +++ b/action.yml @@ -16,3 +16,4 @@ runs: - ${{ inputs.osc_user}} - ${{ inputs.osc_path}} - ${{ inputs.osc_package}} + - ${{ inputs.osc_action}} diff --git a/osc_buildlog.sh b/osc_buildlog.sh index df4783d..89c4255 100755 --- a/osc_buildlog.sh +++ b/osc_buildlog.sh @@ -1,10 +1,5 @@ #!/bin/sh -l -# echo $1 $2 $3 -# echo "${osc_user} ${osc_path} ${osc_package}" -# echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}" -# osc checkout $INPUT_OSC_PATH $INPUT_OSC_PACKAGE - cd "${INPUT_OSC_PATH}/${INPUT_OSC_PACKAGE}" osc buildlog openSUSE_Factory x86_64 echo "Getting binaries from the obs"; diff --git a/osc_checkout b/osc_checkout index 5b1ff0c..9283e31 100755 --- a/osc_checkout +++ b/osc_checkout @@ -1,10 +1,5 @@ #!/usr/bin/expect -f - -# echo $1 $2 $3 -# echo "${osc_user} ${osc_path} ${osc_package}" -# echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}" - set timeout -1 spawn osc checkout "$env(INPUT_OSC_PATH)" "$env(INPUT_OSC_PACKAGE)" expect { @@ -17,4 +12,3 @@ expect { send "osc buildlog openSUSE_Factory x86_64\r"; exp_continue } } - diff --git a/osc_local_build.sh b/osc_local_build.sh new file mode 100755 index 0000000..daccf99 --- /dev/null +++ b/osc_local_build.sh @@ -0,0 +1,7 @@ +#!/bin/sh -l + +cd "${INPUT_OSC_PATH}/${INPUT_OSC_PACKAGE}" +echo "Building binaries in the local container"; +osc build openSUSE_Factory x86_64 + + diff --git a/runner.sh b/runner.sh index 5ea5f1a..f8327be 100755 --- a/runner.sh +++ b/runner.sh @@ -1,9 +1,17 @@ #!/bin/sh -l -echo $1 $2 $3 +echo $1 $2 $3 $4 echo "${osc_user} ${osc_path} ${osc_package}" echo "${INPUT_OSC_USER} ${INPUT_OSC_PATH} ${INPUT_OSC_PACKAGE}" # osc checkout $INPUT_OSC_PATH $INPUT_OSC_PACKAGE # osc buildlog openSUSE_Factory x86_64 -/usr/bin/expect /osc_checkout -/osc_buildlog.sh +if [ "$4" = "buildlog" ]; then + echo "OBS buildlog ..." + /usr/bin/expect /osc_checkout + /osc_buildlog.sh +elif [ "$4" = "build" ]; then + echo "Triggering local build..." + /usr/bin/expect /osc_checkout + /osc_local_build.sh +fi +