|
23 | 23 | secrets: |
24 | 24 | SIGNING_SECRET: |
25 | 25 | required: false |
| 26 | + GITHUB_TOKEN: |
| 27 | + required: true |
26 | 28 |
|
27 | 29 | env: |
28 | 30 | IMAGE_DESC: "Experimental arch-bootc POC image" |
@@ -106,8 +108,26 @@ jobs: |
106 | 108 | target-dir: /var/lib/containers |
107 | 109 | mount-opts: compress-force=zstd:2 |
108 | 110 |
|
109 | | - - name: Install just |
110 | | - uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4 |
| 111 | + # We need newer podman due to old podman not supporting lots of flags |
| 112 | + - name: Update podman and install just |
| 113 | + shell: bash |
| 114 | + run: | |
| 115 | + set -eux |
| 116 | + # Require the runner is ubuntu-24.04 |
| 117 | + IDV=$(. /usr/lib/os-release && echo ${ID}-${VERSION_ID}) |
| 118 | + test "${IDV}" = "ubuntu-24.04" |
| 119 | + # resolute is the next release. The azure.archive.ubuntu.com mirror only carries amd64. |
| 120 | + # Other architectures like arm64 use ports.ubuntu.com/ubuntu-ports. |
| 121 | + if [ "$(dpkg --print-architecture)" = "amd64" ]; then |
| 122 | + mirror="http://azure.archive.ubuntu.com/ubuntu" |
| 123 | + else |
| 124 | + mirror="http://ports.ubuntu.com/ubuntu-ports" |
| 125 | + fi |
| 126 | + echo "deb ${mirror} resolute universe main" | sudo tee /etc/apt/sources.list.d/resolute.list |
| 127 | + /bin/time -f '%E %C' sudo apt update |
| 128 | + # skopeo is currently older in resolute for some reason hence --allow-downgrades |
| 129 | + /bin/time -f '%E %C' sudo apt install -y --allow-downgrades crun/resolute buildah/resolute podman/resolute skopeo/resolute just/resolute |
| 130 | + podman --version |
111 | 131 |
|
112 | 132 | - name: Install mkosi |
113 | 133 | uses: systemd/mkosi@c4c3d793d0f6f0a2f26895de5ed9382396f36bb5 |
@@ -140,26 +160,29 @@ jobs: |
140 | 160 | done |
141 | 161 |
|
142 | 162 | - name: Login to GitHub Container Registry |
143 | | - uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4 |
144 | 163 | if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
145 | | - with: |
146 | | - registry: ghcr.io |
147 | | - username: ${{ github.actor }} |
148 | | - password: ${{ secrets.GITHUB_TOKEN }} |
| 164 | + env: |
| 165 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 166 | + LOGIN_USER: ${{ github.actor }} |
| 167 | + run: echo "${GITHUB_TOKEN}" | sudo podman login -u "${LOGIN_USER}" --password-stdin "ghcr.io" |
149 | 168 |
|
150 | | - - name: Push To GHCR |
151 | | - uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2 |
| 169 | + - name: Push to GHCR |
152 | 170 | if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
153 | 171 | id: push |
154 | 172 | env: |
155 | | - REGISTRY_USER: ${{ github.actor }} |
156 | | - REGISTRY_PASSWORD: ${{ github.token }} |
157 | | - with: |
158 | | - registry: ${{ env.IMAGE_REGISTRY }} |
159 | | - image: ${{ env.IMAGE_NAME }} |
160 | | - tags: ${{ steps.metadata.outputs.tags }} |
161 | | - username: ${{ env.REGISTRY_USER }} |
162 | | - password: ${{ env.REGISTRY_PASSWORD }} |
| 173 | + IMAGE_DIGEST: ${{ steps.load.outputs.digest }} |
| 174 | + MAX_RETRIES: 3 |
| 175 | + PLATFORM: ${{ matrix.platform }} |
| 176 | + REPOSITORY_OWNER: ${{ github.repository_owner }} |
| 177 | + SIGNING_SECRET: ${{ secrets.SIGNING_SECRET }} |
| 178 | + run: | |
| 179 | + # HACK: push two times so layer annotations are present |
| 180 | + # TODO: remove me when https://github.com/containers/podman/issues/27796 fixed |
| 181 | + for tag in $DOCKER_METADATA_OUTPUT_TAGS; do |
| 182 | + for _ in $(seq 2); do |
| 183 | + sudo podman push --retry "${MAX_RETRIES}" --compression-format=zstd "localhost/${IMAGE_NAME}:${DEFAULT_TAG}" "${IMAGE_REGISTRY}/${IMAGE_NAME}:$tag" |
| 184 | + done |
| 185 | + done |
163 | 186 |
|
164 | 187 | - name: Install Cosign |
165 | 188 | uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 |
|
0 commit comments