name: configure s3cmd description: configure s3cmd inputs: s3_key_id: required: true description: "s3 key id" s3_key_secret: required: true description: "s3 key secret" s3_bucket: required: false description: "s3 bucket" s3_endpoint: required: true description: "s3 endpoint" folder_prefix: required: false description: "folder prefix" build_preset: required: false description: "build preset like relwithdebinfo" runs: using: "composite" steps: - name: configure s3cmd shell: bash run: | export S3CMD_CONFIG=$(mktemp) echo "S3CMD_CONFIG=$S3CMD_CONFIG" >> $GITHUB_ENV cat < $S3CMD_CONFIG [default] access_key = ${s3_key_id} secret_key = ${s3_secret_access_key} bucket_location = ru-central1 host_base = storage.yandexcloud.net host_bucket = %(bucket)s.storage.yandexcloud.net EOF env: s3_key_id: ${{ inputs.s3_key_id }} s3_secret_access_key: ${{ inputs.s3_key_secret }} - name: export s3 path variables shell: bash if: inputs.build_preset run: | folder="${{ runner.arch == 'X64' && 'x86-64' || runner.arch == 'ARM64' && 'arm64' || 'unknown' }}" BUILD_PRESET="${{ inputs.build_preset }}" case "$BUILD_PRESET" in relwithdebinfo) ;; debug) folder+="-debug" ;; release-*) folder+="-${BUILD_PRESET/release-/}" ;; *) echo "Invalid preset: ${{ inputs.build_preset }}" exit 1 ;; esac echo "S3_BUCKET_PATH=s3://${{ inputs.s3_bucket }}/${{ github.repository }}/${{github.workflow}}/${{ github.run_id }}/${{ inputs.folder_prefix }}${folder}" >> $GITHUB_ENV echo "S3_URL_PREFIX=${{ inputs.s3_endpoint }}/${{ inputs.s3_bucket }}/${{ github.repository }}/${{ github.workflow }}/${{ github.run_id }}/${{ inputs.folder_prefix }}${folder}" >> $GITHUB_ENV echo "S3_TEST_ARTIFACTS_BUCKET_PATH=s3://${{ inputs.s3_bucket }}/testing_out_stuff/${{ github.repository }}/${{github.workflow}}/${{ github.run_id }}/${{ inputs.folder_prefix }}${folder}" >> $GITHUB_ENV echo "S3_TEST_ARTIFACTS_URL_PREFIX=${{ inputs.s3_endpoint }}/${{ inputs.s3_bucket }}/testing_out_stuff/${{ github.repository }}/${{ github.workflow }}/${{ github.run_id }}/${{ inputs.folder_prefix }}${folder}" >> $GITHUB_ENV