Skip to content

Commit

Permalink
Test build OCI rpm old
Browse files Browse the repository at this point in the history
  • Loading branch information
isboston committed Jan 25, 2025
1 parent e0cd33b commit 7f46a96
Showing 1 changed file with 51 additions and 51 deletions.
102 changes: 51 additions & 51 deletions .github/workflows/build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ on:
- 'release/**'
- 'hotfix/**'
- 'develop'
- 'feature/test-build-develop'
paths:
- 'install/common/**'
- 'install/deb/**'
- 'install/rpm/**'
- '.github/workflows/build_packages.yml'
workflow_dispatch:
inputs:
Expand Down Expand Up @@ -43,9 +41,9 @@ 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: 'feature/test-build-develop'
BRANCH_CLIENT: 'develop'
BRANCH_SERVER: 'develop'

jobs:
prepare:
Expand All @@ -58,12 +56,12 @@ jobs:
with:
fetch-depth: 0

- name: Determine changed
id: changes
run: |
git fetch --no-tags --prune --depth=2
CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
echo "build_all=$(echo "$CHANGED_FILES" | grep -qE '^.github/workflows/build_packages.yml' && echo true || echo false)" >> $GITHUB_OUTPUT
# - name: Determine changed
# id: changes
# run: |
# git fetch --no-tags --prune --depth=2
# CHANGED_FILES=$(git diff --name-only HEAD~1 HEAD)
# echo "build_all=$(echo "$CHANGED_FILES" | grep -qE '^.github/workflows/build_packages.yml' && echo true || echo false)" >> $GITHUB_OUTPUT
- name: Set matrix
id: set-matrix
run: |
Expand All @@ -85,7 +83,9 @@ jobs:
needs: prepare
runs-on: ubuntu-22.04
strategy:
matrix: ${{ fromJson(needs.prepare.outputs.matrix) }}
matrix:
include:
- packageType: rpm
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -96,7 +96,7 @@ jobs:
run: |
PRODUCT_VERSION=$(grep -oP '\d+\.\d+\.\d+' <<< "${BRANCH_BUILDTOOLS//\//} ${BRANCH_CLIENT//\//} \
${BRANCH_SERVER//\//}" | head -n1)
echo "PRODUCT_VERSION=${PRODUCT_VERSION:-3.0.1}" >> $GITHUB_ENV
echo "PRODUCT_VERSION=${PRODUCT_VERSION:-3.0.2}" >> $GITHUB_ENV
- name: Free Disk Space
run: |
Expand Down Expand Up @@ -204,42 +204,42 @@ jobs:
&& echo "Success: $(basename "$rpm_package") uploaded." || echo "Error: Failed to upload $(basename "$rpm_package")"
done
- name: Checking the DEB package for errors
if: matrix.packageType == 'deb'
run: |
lintian --profile debian ${PACKAGE_DIRECTORY}/install/*.deb | tee -a LINTIAN
if grep -qE '^(W:|E:)' LINTIAN; then
echo "::warning Noticedeb=lintian::$(cat LINTIAN | awk '/^W:/ { ws += 1 } /^E:/ { es += 1 } END { print "Warnings:", ws, "Errors:", es }')"
fi
- name: Checking the RPM package for errors
if: matrix.packageType == 'rpm'
run: |
for rpm_package in ${PACKAGE_DIRECTORY}/install/rpm/SPECS/RPMS/noarch/*.rpm; do
rpmlint --ignore-unused-rpmlintrc --rpmlintrc ${PACKAGE_DIRECTORY}/install/rpm/SPECS/SOURCES/${PRODUCT_LOW}.rpmlintrc $rpm_package | tee -a RPM_LINT
done
if grep -qE '(W:|E:)' RPM_LINT; then
echo "::warning Noticerpm=rpmlint::$(cat RPM_LINT | awk '/W:/ { ws += 1 } /E:/ { es += 1 } END { print "Warnings:", ws, "Errors:", es }')"
fi
# - name: Checking the DEB package for errors
# if: matrix.packageType == 'deb'
# run: |
# lintian --profile debian ${PACKAGE_DIRECTORY}/install/*.deb | tee -a LINTIAN
# if grep -qE '^(W:|E:)' LINTIAN; then
# echo "::warning Noticedeb=lintian::$(cat LINTIAN | awk '/^W:/ { ws += 1 } /^E:/ { es += 1 } END { print "Warnings:", ws, "Errors:", es }')"
# fi

# - name: Checking the RPM package for errors
# if: matrix.packageType == 'rpm'
# run: |
# for rpm_package in ${PACKAGE_DIRECTORY}/install/rpm/SPECS/RPMS/noarch/*.rpm; do
# rpmlint --ignore-unused-rpmlintrc --rpmlintrc ${PACKAGE_DIRECTORY}/install/rpm/SPECS/SOURCES/${PRODUCT_LOW}.rpmlintrc $rpm_package | tee -a RPM_LINT
# done
# if grep -qE '(W:|E:)' RPM_LINT; then
# 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: build
runs-on: ubuntu-22.04
if: ${{ success() }}
steps:
- name: Trigger CI-OCI-Install Workflow
run: |
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": "'"${{ github.event.inputs.deb_build }}"'",
"rpm_build": "'"${{ github.event.inputs.rpm_build }}"'"
}
}'
# trigger_oci:
# name: Trigger ci-oci-install Workflow
# needs: build
# runs-on: ubuntu-22.04
# if: ${{ success() }}
# steps:
# - name: Trigger CI-OCI-Install Workflow
# run: |
# 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": "'"${{ github.event.inputs.deb_build }}"'",
# "rpm_build": "'"${{ github.event.inputs.rpm_build }}"'"
# }
# }'

0 comments on commit 7f46a96

Please sign in to comment.