Skip to content

Commit

Permalink
Test build OCI
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 24, 2025
1 parent bef64d2 commit 0d46e16
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ on:
- 'release/**'
- 'hotfix/**'
- 'develop'
- 'feature/test-build'
paths:
- '.github/workflows/build_packages.yml'
workflow_dispatch:
Expand All @@ -29,7 +30,7 @@ on:
rpm_build:
description: 'Trigger RPM build'
required: false
default: 'false'
default: 'true'

concurrency:
group: ${{ github.ref }}
Expand All @@ -40,36 +41,36 @@ env:
PRODUCT_LOW: "docspace"
BUILD_NUMBER: ${{ github.run_number }}
PACKAGE_DIRECTORY: "/home/runner/work/${{ github.event.repository.name }}/${{ github.event.repository.name }}"
BRANCH_BUILDTOOLS: ${{ github.event.inputs.branch-buildtools != '' && github.event.inputs.branch-buildtools || github.ref_name || 'develop' }}
BRANCH_CLIENT: ${{ github.event.inputs.branch-client != '' && github.event.inputs.branch-client || github.ref_name || 'develop' }}
BRANCH_SERVER: ${{ github.event.inputs.branch-server != '' && github.event.inputs.branch-server || github.ref_name || 'develop' }}
BRANCH_BUILDTOOLS: 'develop'
BRANCH_CLIENT: 'develop'
BRANCH_SERVER: 'develop'

jobs:
prepare:
runs-on: ubuntu-22.04
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
build_all: ${{ steps.changes.outputs.build_all }}
# build_all: ${{ steps.changes.outputs.build_all }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Determine changed
id: changes
run: |
git fetch --no-tags --prune --depth=2
echo "build_all=$(git diff --name-only HEAD~1 HEAD | grep -qE 'build_packages.yml' && echo true)" >> $GITHUB_OUTPUT
# - name: Determine changed
# id: changes
# run: |
# git fetch --no-tags --prune --depth=2
# echo "build_all=$(git diff --name-only HEAD~1 HEAD | grep -qE 'build_packages.yml' && echo true)" >> $GITHUB_OUTPUT
- name: Set matrix
id: set-matrix
run: |
package_types=()
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
[[ "${{ github.event.inputs.deb_build }}" == "true" ]] && package_types+=("deb")
[[ "${{ github.event.inputs.rpm_build }}" == "true" ]] && package_types+=("rpm")
elif [[ "${{ steps.changes.outputs.build_all }}" == "true" ]]; then
package_types+=("deb" "rpm")
# elif [[ "${{ steps.changes.outputs.build_all }}" == "true" ]]; then
# package_types+=("deb" "rpm")
else
[[ "${{ github.event.inputs.deb_build }}" == "true" ]] && package_types+=("deb")
[[ "${{ github.event.inputs.rpm_build }}" == "true" ]] && package_types+=("rpm")
Expand Down Expand Up @@ -219,27 +220,27 @@ jobs:
echo "::warning Noticerpm=rpmlint::$(cat RPM_LINT | awk '/W:/ { ws += 1 } /E:/ { es += 1 } END { print "Warnings:", ws, "Errors:", es }')"
fi
trigger_oci:
name: Trigger ci-oci-install Workflow
needs: [prepare, build]
runs-on: ubuntu-22.04
if: ${{ success() }}
steps:
- name: Trigger CI-OCI-Install Workflow
run: |
deb_build="${{ github.event.inputs.deb_build }}"
rpm_build="${{ github.event.inputs.rpm_build }}"
[[ "${{ needs.prepare.outputs.build_all }}" == "true" ]] && deb_build="true" && rpm_build="true"
curl \
-X POST \
-u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \
https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/actions/workflows/85067971/dispatches \
-H "Accept: application/vnd.github.everest-preview+json" \
--data '{
"ref": "'"${{ github.ref_name }}"'",
"inputs": {
"deb_build": "'"${deb_build}"'",
"rpm_build": "'"${rpm_build}"'"
}
}'
# trigger_oci:
# name: Trigger ci-oci-install Workflow
# needs: [prepare, build]
# runs-on: ubuntu-22.04
# if: ${{ success() }}
# steps:
# - name: Trigger CI-OCI-Install Workflow
# run: |
# deb_build="${{ github.event.inputs.deb_build }}"
# rpm_build="${{ github.event.inputs.rpm_build }}"
# [[ "${{ needs.prepare.outputs.build_all }}" == "true" ]] && deb_build="true" && rpm_build="true"
# curl \
# -X POST \
# -u "${{ secrets.USERNAME}}:${{secrets.TOKEN}}" \
# https://api.github.com/repos/ONLYOFFICE/DocSpace-buildtools/actions/workflows/85067971/dispatches \
# -H "Accept: application/vnd.github.everest-preview+json" \
# --data '{
# "ref": "'"${{ github.ref_name }}"'",
# "inputs": {
# "deb_build": "'"${deb_build}"'",
# "rpm_build": "'"${rpm_build}"'"
# }
# }'

0 comments on commit 0d46e16

Please sign in to comment.