version: 1
kind: pipeline
spec:
  stages:
    - name: binary_x64
      type: ci
      spec:
        steps:
          - name: build
            type: run
            spec:
              container: themackabu/rust:zigbuild-1.79.0
              script: |-
                apt-get update -yqq
                apt-get install -yqq zip clang llvm
                export CC="/usr/bin/clang"
                export CXX="/usr/bin/clang++"
                cargo zigbuild -r -j 4
                zip pmc_${{ build.commit }}-B${{ build.number }}.zip target/release/pmc -j
          - spec:
              inputs:
                access_key: ${{ secrets.get("pmc_s3_key") }}
                acl: read-write
                bucket: themackabu-bun-cdn
                region: us1
                path_style: false
                endpoint: https://gateway.storjshare.io
                secret_key: ${{ secrets.get("pmc_s3_secret") }}
                target: gitness
                source: pmc_${{ build.commit }}-B${{ build.number }}.zip
              name: s3
            type: plugin
            name: upload
