From 235c7d82ceff7cad143ee0f07fe3a999102e15b9 Mon Sep 17 00:00:00 2001 From: Jakub Panek Date: Tue, 28 Jan 2025 14:50:04 +0000 Subject: [PATCH] fixup! migrate docker-images --- .github/actions/buildah/action.yml | 39 ++++++++++++++++++ .github/workflows/build-ubuntu.yml | 65 +++--------------------------- 2 files changed, 45 insertions(+), 59 deletions(-) create mode 100644 .github/actions/buildah/action.yml diff --git a/.github/actions/buildah/action.yml b/.github/actions/buildah/action.yml new file mode 100644 index 00000000..91546ca8 --- /dev/null +++ b/.github/actions/buildah/action.yml @@ -0,0 +1,39 @@ +name: Install build tools +description: 'Install build tools' +runs: + using: composite + steps: + - name: buildah + shell: sh + run: | + sudo apt-get -y -qq update + sudo apt-get -y install bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make skopeo + git clone https://github.com/containers/buildah buildah + git -C buildah checkout v1.38.0 + make -C buildah buildah + sudo mkdir -p /usr/local/bin/ + sudo cp "$PWD/buildah/bin"/* /usr/local/bin/ + + - name: netavark + shell: sh + run: | + curl -L https://github.com/containers/netavark/releases/download/v1.13.1/netavark.gz --output netavark.gz + gzip -d netavark.gz + chmod +x netavark + sudo mkdir -p /usr/local/libexec/podman/ + mv netavark /usr/local/libexec/podman/ + + - name: crun + shell: sh + run: | + curl -L https://github.com/containers/crun/releases/download/1.19.1/crun-1.19.1-linux-amd64 --output crun + chmod +x crun + sudo cp crun /usr/local/bin/crun + echo "BUILDAH_RUNTIME=/usr/local/bin/crun" >> $GITHUB_ENV + + - name: passt + shell: sh + run: | + git clone https://passt.top/passt + make -C passt + sudo make -C passt install diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 949c7cac..dccfc1b2 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -20,7 +20,6 @@ on: env: IMAGE_LABEL_OWNER: ${{ github.repository_owner }} IMAGE_LABEL_REPO: ${{ github.repository }} - SLUG: ${{ github.repository_owner }}/act DISTRO: ubuntu NODE: '16 18 20 22' BUILD_REF: ${{ github.sha }} @@ -40,7 +39,7 @@ jobs: runs-on: ubuntu-latest env: PLATFORMS: ${{ matrix.PLATFORMS }} - SLUG: ${{ env.SLUG }}-minimal + SLUG: ${{ github.repository_owner }}/act-minimal strategy: fail-fast: true max-parallel: 4 @@ -59,34 +58,10 @@ jobs: with: go-version: '>=1.21.0' + - uses: actions/checkout@v3 + - name: Setup buildah - run: | - # buildah - sudo apt-get -y -qq update - sudo apt-get -y install bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make skopeo - git clone https://github.com/containers/buildah buildah - git -C buildah checkout v1.38.0 - make -C buildah buildah - sudo mkdir -p /usr/local/bin/ - sudo cp "$PWD/buildah/bin"/* /usr/local/bin/ - - # netavark - curl -L https://github.com/containers/netavark/releases/download/v1.13.1/netavark.gz --output netavark.gz - gzip -d netavark.gz - chmod +x netavark - sudo mkdir -p /usr/local/libexec/podman/ - mv netavark /usr/local/libexec/podman/ - - # crun - curl -L https://github.com/containers/crun/releases/download/1.19.1/crun-1.19.1-linux-amd64 --output crun - chmod +x crun - sudo cp crun /usr/local/bin/crun - echo "BUILDAH_RUNTIME=/usr/local/bin/crun" >> $GITHUB_ENV - - # passt - git clone https://passt.top/passt - make -C passt - sudo make -C passt install + uses: ./.github/actions/buildah - name: Force SLUG to lowercase uses: actions/github-script@v6 @@ -122,8 +97,6 @@ jobs: - name: Set up QEMU uses: docker/setup-qemu-action@v2 - - uses: actions/checkout@v3 - - name: Build and push ${{ env.DISTRO }}:${{ env.TAG }} shell: buildah unshare pwsh "{0}" env: @@ -233,7 +206,7 @@ jobs: PLATFORMS: ${{ matrix.PLATFORMS }} BUILD_TAG: ${{ matrix.TYPE }}-${{ matrix.TAG }} TYPE: ${{ matrix.TYPE }} - SLUG: ${{ env.SLUG }}-${{ matrix.TYPE }} + SLUG: ${{ github.repository_owner }}/act-${{ matrix.TYPE }} strategy: fail-fast: false max-parallel: 8 @@ -277,33 +250,7 @@ jobs: go-version: '>=1.21.0' - name: Setup buildah - run: | - # buildah - sudo apt-get -y -qq update - sudo apt-get -y install bats btrfs-progs git go-md2man golang libapparmor-dev libglib2.0-dev libgpgme11-dev libseccomp-dev libselinux1-dev make skopeo - git clone https://github.com/containers/buildah buildah - git -C buildah checkout v1.38.0 - make -C buildah buildah - sudo mkdir -p /usr/local/bin/ - sudo cp "$PWD/buildah/bin"/* /usr/local/bin/ - - # netavark - curl -L https://github.com/containers/netavark/releases/download/v1.13.1/netavark.gz --output netavark.gz - gzip -d netavark.gz - chmod +x netavark - sudo mkdir -p /usr/local/libexec/podman/ - mv netavark /usr/local/libexec/podman/ - - # crun - curl -L https://github.com/containers/crun/releases/download/1.19.1/crun-1.19.1-linux-amd64 --output crun - chmod +x crun - sudo cp crun /usr/local/bin/crun - echo "BUILDAH_RUNTIME=/usr/local/bin/crun" >> $GITHUB_ENV - - # passt - git clone https://passt.top/passt - make -C passt - sudo make -C passt install + uses: ./.github/actions/buildah - name: Cleanup run: |