Skip to content

build(debian): sid

build(debian): sid #75

Workflow file for this run

name: build (Unstable, Sid)
# auto-task.start-build-time = 2024-11-09 01:01:09.838914844+00:00
on: { "push": { "paths": [".github/workflows/sid.yml"] } }
env:
DEBIAN_FRONTEND: noninteractive
GET_CTR_LOG: debug
ZSTD_LV: 18
ARCHS: ${{ fromJson(vars.SID_JSON).archs }}
BUILD_CMD: get-ctr --os ${{vars.OS}} --ver ${{fromJson(vars.SID_JSON).ver}}
jobs:
build:
strategy:
fail-fast: true
matrix: ${{ fromJson(vars.SID_JSON).matrix }}
runs-on: ubuntu-latest
steps:
- name: preparations
run: |
${{vars.INSTALL_QEMU_AND_DEBOOTSTRAP}}
${{vars.GET_CTR_CMD}}
- name: Login to REG
uses: docker/login-action@v3
with:
registry: ${{vars.REG_URI}}
username: ${{vars.REG_USER}}
password: ${{ secrets.DEB_UUU_TOKEN }}
- name: download & repack rootfs & save cache
run: ${{env.BUILD_CMD}} --arch ${{matrix.arch}} --obtain --repack --zstd-level ${{env.ZSTD_LV}} --save-cache
docker:
needs: build
runs-on: ubuntu-latest
# defaults:
# run:
# shell: zsh -fe {0}
env:
digests_ron: digests.ron
digests_yaml: digests.yml
steps:
- name: Login to REG
uses: docker/login-action@v3
with:
registry: ${{vars.REG_URI}}
username: ${{vars.REG_USER}}
password: ${{ secrets.DEB_UUU_TOKEN }}
- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get `get-ctr` bin from docker
run: ${{vars.GET_CTR_CMD}}
- name: install qemu-user & debootstrap
run: ${{vars.INSTALL_QEMU_AND_DEBOOTSTRAP}}
- name: restore cache
run: |
archs=( ${{env.ARCHS}} )
for arch in "${archs[@]}"; do
${{env.BUILD_CMD}} --restore-cache --arch $arch
tree tmp
done
- name: build container
run: ${{env.BUILD_CMD}} --build
- name: push to ghcr & reg
run: ${{env.BUILD_CMD}} --push
- name: create manifest
run: ${{env.BUILD_CMD}} --create-manifest --update-repo-digest
- name: generate digests.{ron,yml}
run: ${{env.BUILD_CMD}} --digest ${{env.digests_ron}} --digest ${{env.digests_yaml}}
- name: create digests.md
run: |
echo '```yaml' > digests.md
cat tmp/${{env.digests_yaml}} >> digests.md
echo '```' >> digests.md
echo TITLE=$(${{env.BUILD_CMD}} --title) >>$GITHUB_ENV
- name: +RELEASE_TAG env
run: echo RELEASE_TAG=$(${{env.BUILD_CMD}} --release-tag) >>$GITHUB_ENV
- name: release
uses: softprops/action-gh-release@v1
with:
fail_on_unmatched_files: true
tag_name: ${{env.RELEASE_TAG}}
name: ${{env.TITLE}}
files: |
tmp/zstd/*.zst
tmp/${{env.digests_ron}}
tmp/${{env.digests_yaml}}
body_path: digests.md