matrix:
  platform:
    - linux/amd64
    - linux/arm64

labels:
  type: exec
  platform: ${platform}

steps:
- name: publish-linux
  image: bash
  commands:
  - echo $CONTAINER_PASSWORD | podman login $DRYCC_REGISTRY --username $CONTAINER_USERNAME --password-stdin > /dev/null 2>&1
  - sed -i "s/registry.drycc.cc/$${DRYCC_REGISTRY}/g" builder.toml
  - sed -i "s/{{CODENAME}}/$${CODENAME}/g" builder.toml
  - export PACK_HOME=$CI_WORKSPACE
  - make publish-buildpack
  environment:
    CODENAME:
      from_secret: codename
    DEV_REGISTRY:
      from_secret: dev_registry
    DRYCC_REGISTRY:
      from_secret: drycc_registry
    CONTAINER_USERNAME:
      from_secret: container_username
    CONTAINER_PASSWORD:
      from_secret: container_password
  when:
    event:
    - push
    - tag
    - cron

depends_on:
- test-linux
- manifest-pack
