/
githubmirror
/
setools
Обзор
Документация
Войти
/
githubmirror
/
setools
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
.github/workflows/build-userspace.yml
80 строк
2 KB
Chris PeBenito
CI: Update userspace build to use the GH action in the userspace repo.
11 июн 2026, 16:27
Не верифицирован
11 июн 2026, 16:27
27170ec
Код
Авторство
О чём код?
name: "Build SELinux userspace" on: workflow_call: inputs: version: description: "Userspace version (a git commit ID, tag, or branch)" required: false type: string python-version: description: "Python version to use" required: true type: string ruby-version: description: "Ruby version to use" required: true type: string outputs: binary-id: description: "Userspace binary artifact ID" value: ${{ jobs.build.outputs.binary-id }} jobs: build: runs-on: ubuntu-22.04 outputs: binary-id: ${{ steps.upload-artifact.outputs.artifact-id }} steps: - name: Checkout SELinux userspace tools and libs uses: actions/checkout@v6 with: repository: SELinuxProject/selinux ref: "${{ inputs.version }}" - name: Get the latest commit hash shell: bash run: echo "COMMIT_HASH=$(git rev-parse HEAD)" >> $GITHUB_ENV - name: Download cached SELinux userspace uses: actions/cache@v5 id: cache-userspace with: path: ${{ github.workspace }}/selinux.tar.gz key: selinux-${{ inputs.version }}-${{ env.COMMIT_HASH }}-${{ runner.os }}-${{ runner.arch }}-Python${{ inputs.python-version }} - name: Build SELinux userspace if: ${{ steps.cache-userspace.outputs.cache-hit != 'true' }} #The new GH action is not available in a release yet. uses: SELinuxProject/selinux/.github/actions/build-userspace@main #uses: SELinuxProject/selinux/.github/actions/build-userspace@${{ inputs.version }} id: build-userspace with: python-version: "${{ inputs.python-version }}" compiler: gcc ruby-version: "${{ inputs.ruby-version }}" - name: Create artifact if: ${{ steps.cache-userspace.outputs.cache-hit != 'true' }} shell: bash id: create-artifact working-directory: "${{ steps.build-userspace.outputs.DESTDIR }}" run: | # Create a tarball of the binary directory tar -czf "${{ github.workspace }}/selinux.tar.gz" . - name: Upload artifact uses: actions/upload-artifact@v7 id: upload-artifact with: name: selinux path: "${{ github.workspace }}/selinux.tar.gz" - name: Upload failed build directory if: ${{ failure() && runner.debug }} uses: actions/upload-artifact@v7 with: name: failed-selinux path: | ${{ github.workspace }}