ci(debian): build 2.2 & 3.0 #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: get Bo, Hamm, Slink & Potato rootfs | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
GET_CTR_LOG: debug | |
REG_USER: "robot$debian+bot_actions_2024" | |
ZSTD_LV: 18 | |
on: | |
push: | |
# branches: | |
# - master | |
paths: | |
- ".github/workflows/debian.yml" | |
jobs: | |
build: | |
strategy: | |
fail-fast: true | |
matrix: | |
include: | |
# - os: debian | |
# ver: "1.3" | |
# - os: debian | |
# ver: "2.0" | |
# - os: debian | |
# ver: "2.1" | |
# - os: debian | |
# ver: "2.2" | |
# tag: base | |
- os: debian | |
ver: "2.2" | |
- os: debian | |
ver: "3.0" | |
runs-on: ubuntu-latest | |
# defaults: | |
# run: | |
# shell: zsh -f -e {0} | |
env: | |
digests_ron: digests.ron | |
digests_yaml: digests.yml | |
build_cmd: get-ctr --os ${{matrix.os}} --ver ${{matrix.ver}} --tag ${{matrix.tag}} | |
steps: | |
- name: get `get-ctr` bin from docker | |
run: docker run -i --rm -v /usr/local/bin:/host --pull always reg.tmoe.me:2096/rs/get-ctr:x64 cp get-ctr /host | |
- name: install qemu-user | |
run: | | |
sudo apt-get update | |
yes | sudo apt-get install qemu-user-static | |
- name: +RELEASE_TAG env | |
run: echo RELEASE_TAG=$(${{env.build_cmd}} --release-tag) >>$GITHUB_ENV | |
- name: download & repack rootfs | |
run: ${{env.build_cmd}} --obtain --repack --zstd-level ${{env.ZSTD_LV}} | |
- name: Login to GHCR | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Login to REG | |
uses: docker/login-action@v3 | |
with: | |
registry: reg.tmoe.me:2096 | |
username: ${{env.REG_USER}} | |
password: ${{ secrets.REG_TOKEN }} | |
- 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 | |
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 |