--- name: Build DEB 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 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: DEB 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:debian-12 steps: # Checkout here so we can easily use custom actions - uses: actions/checkout@v4 # Checkout here for the build process - name: Checkout in build directory uses: actions/checkout@v4 with: path: pkgs/checkout/ - 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: pkgs/checkout/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 path: pkgs/checkout/ - name: Setup Python Tools Scripts uses: ./.github/actions/setup-python-tools-scripts with: cwd: pkgs/checkout/ - name: Setup Salt Version id: setup-salt-version uses: ./.github/actions/setup-salt-version with: salt-version: "${{ inputs.salt-version }}" cwd: pkgs/checkout/ - name: Configure Git if: ${{ startsWith(github.event.ref, 'refs/tags') == false }} working-directory: pkgs/checkout/ run: | tools pkg configure-git - name: Apply release patch if: ${{ startsWith(github.event.ref, 'refs/tags') == false }} working-directory: pkgs/checkout/ run: | tools pkg apply-release-patch salt-${{ inputs.salt-version }}.patch --delete - name: Build Deb working-directory: pkgs/checkout/ run: | tools pkg build deb --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: Cleanup run: | rm -rf pkgs/checkout/ - name: Set Artifact Name id: set-artifact-name run: | if [ "${{ inputs.source }}" != "src" ]; then echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-deb" >> "$GITHUB_OUTPUT" else echo "artifact-name=salt-${{ inputs.salt-version }}-${{ matrix.arch }}-deb-from-src" >> "$GITHUB_OUTPUT" fi - name: Upload DEBs uses: actions/upload-artifact@v3 with: name: ${{ steps.set-artifact-name.outputs.artifact-name }} path: ${{ github.workspace }}/pkgs/* retention-days: 7 if-no-files-found: error