--- name: Build RPM Packages on: workflow_call: inputs: salt-version: type: string required: true description: The Salt version to set prior to building packages. relenv-version: type: string required: true description: The relenv version to set prior to building packages. python-version: required: true type: string description: The version of python to use with relenv source: required: true type: string description: The backend to build the packages with cache-prefix: required: true type: string description: Seed used to invalidate caches env: COLUMNS: 190 AWS_MAX_ATTEMPTS: "10" AWS_RETRY_MODE: "adaptive" PIP_INDEX_URL: https://pypi-proxy.saltstack.net/root/local/+simple/ PIP_EXTRA_INDEX_URL: https://pypi.org/simple jobs: build: name: RPM runs-on: - self-hosted - linux - ${{ matrix.arch }} strategy: fail-fast: false matrix: arch: - x86_64 - aarch64 source: - ${{ inputs.source }} container: image: ghcr.io/saltstack/salt-ci-containers/packaging:centosstream-9 steps: - uses: actions/checkout@v4 - name: Download Onedir Tarball as an Artifact uses: actions/download-artifact@v3 with: name: salt-${{ inputs.salt-version }}-onedir-linux-${{ matrix.arch }}.tar.xz path: artifacts/ - name: Download Release Patch if: ${{ startsWith(github.event.ref, 'refs/tags') == false }} uses: actions/download-artifact@v3 with: name: salt-${{ inputs.salt-version }}.patch - name: Setup Python Tools Scripts uses: ./.github/actions/setup-python-tools-scripts with: cache-prefix: ${{ inputs.cache-prefix }} - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version with: salt-version: "${{ inputs.salt-version }}" - name: Configure Git if: ${{ startsWith(github.event.ref, 'refs/tags') == false }} run: | tools pkg configure-git - name: Apply release patch if: ${{ startsWith(github.event.ref, 'refs/tags') == false }} run: | tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete - name: Build RPM run: | tools pkg build rpm --relenv-version=${{ inputs.relenv-version }} --python-version=${{ inputs.python-version }} ${{ inputs.source == 'onedir' && format('--onedir=salt-{0}-onedir-linux-{1}.tar.xz', inputs.salt-version, matrix.arch) || format('--arch={0}', matrix.arch) }} - name: Set Artifact Name id: set-artifact-name run: | if [ "${{ inputs.source }}" != "src" ]; then echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-rpm" >> "$GITHUB_OUTPUT" else echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-rpm-from-src" >> "$GITHUB_OUTPUT" fi - name: Upload RPMs uses: actions/upload-artifact@v3 with: name: ${{ steps.set-artifact-name.outputs.artifact-name }} path: ~/rpmbuild/RPMS/${{ matrix.arch }}/*.rpm retention-days: 7 if-no-files-found: error