diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9442435..8280dfb 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,6 +41,11 @@ jobs: publish-script-name: 'release' + env: >- + { + "PL_REGISTRY_MILABORATORIES_UPLOAD_URL": "s3://milab-euce1-prod-pkgs-s3-platforma-registry/pub/?region=eu-central-1" + } + aws-publish-enable: true aws-iam-role-to-assume: 'arn:aws:iam::511903394050:role/milab-euce1-prod-github-oidc-role-pl-registry' diff --git a/package-lock.json b/package-lock.json index 28f12a6..422c679 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.6.2", "license": "UNLICENSED", "devDependencies": { - "@milaboratory/pl-package-builder": "^1.8.2" + "@milaboratory/pl-package-builder": "^2.4.0" } }, "node_modules/@aws-crypto/crc32": { @@ -1039,9 +1039,9 @@ } }, "node_modules/@milaboratory/pl-package-builder": { - "version": "1.8.2", - "resolved": "https://npm.pkg.github.com/download/@milaboratory/pl-package-builder/1.8.2/2e94fe29f284628eebee936b5d0859ac9ecb21dc", - "integrity": "sha512-vpHow3pdv9hTibSAtC43W4NpzG6trjVY1jfAqQ5bo4wjXGRbHmWGfM+rEqiryZX8FuszyyY5a749iuGuh0No9w==", + "version": "2.4.0", + "resolved": "https://npm.pkg.github.com/download/@milaboratory/pl-package-builder/2.4.0/454584cc069b28c2034731d3ed2ffd2db12334c0", + "integrity": "sha512-T65FcIWE1sT+3TO164dZ27cH4v43fFH4vxeGrOGqGxn5ttb0xC6BIzqR0PhprbOqFa96xSAyziOPooVagOVSTw==", "dev": true, "dependencies": { "@aws-sdk/client-s3": "^3.623.0", diff --git a/package.json b/package.json index c144c1b..e2ee0ea 100644 --- a/package.json +++ b/package.json @@ -4,18 +4,64 @@ "description": "Small cross-platform binaries, like 'sleep' or 'hello-world', suitable for test needs", "scripts": { "build": "true", - "pkg:build": "./scripts/build.sh", - "release:packages": "./scripts/publish.sh", - "release:descriptors": "pl-pkg publish descriptor", + "release:descriptors": "pl-pkg publish descriptors", "release": "npm run pkg:build && npm run release:packages && npm run release:descriptors" }, + "block-software": { + "packages": { + "hello-world": { + "binary": { + "registry": { "name": "milaboratories" }, + "name": "common/hello-world", + "version": "1.6.2", + "root": "./nonexistent/", + "entrypoints": { + "hello-world": { "cmd": [ "{pkg}/main" ] } + } + } + }, + "sleep": { + "binary": { + "registry": { "name": "milaboratories" }, + "name": "common/sleep", + "version": "1.6.2", + "root": "./nonexistent/", + "entrypoints": { + "sleep": { "cmd": [ "{pkg}/main" ] } + } + } + }, + "guided-command": { + "binary": { + "registry": { "name": "milaboratories" }, + "name": "common/guided-command", + "version": "1.6.2", + "root": "./nonexistent/", + "entrypoints": { + "guided-command": { "cmd": [ "{pkg}/main" ] } + } + } + }, + "read-file-to-stdout-with-sleep": { + "binary": { + "registry": { "name": "milaboratories" }, + "name": "common/read-file-to-stdout-with-sleep", + "version": "1.6.2", + "root": "./nonexistent/", + "entrypoints": { + "read-file-to-stdout-with-sleep": { "cmd": [ "{pkg}/main" ] } + } + } + } + } + }, "files": [ "dist/" ], "license": "UNLICENSED", "devDependencies": { - "@milaboratory/pl-package-builder": "^1.8.2" + "@milaboratory/pl-package-builder": "^2.4.0" } } diff --git a/scripts/build.sh b/scripts/build.sh index 2d2fc7f..947c27f 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -27,8 +27,8 @@ build_binary() { "./${_bin_name}.go" printf "\n" - pl-pkg build package \ - --package-name="common/${_bin_name}" \ + pl-pkg build packages \ + --package-id="${_bin_name}" \ --os="${_os_reg}" \ --arch="${_arch_reg}" \ --content-root="${BUILD_DIR}/${_group}/${_bin_name}/" @@ -55,9 +55,8 @@ build_binaries() { build_binary "${_bin_name}" "darwin" "amd64" "macosx" "x64" build_binary "${_bin_name}" "darwin" "arm64" "macosx" "aarch64" - pl-pkg build descriptor \ - --name="${_bin_name}" \ - --package-name="common/${_bin_name}" + pl-pkg build descriptors \ + --package-id="${_bin_name}" } rm -rf "${script_dir}/${BUILD_DIR}" @@ -68,6 +67,6 @@ build_binaries "sleep" build_binaries "read-file-to-stdout-with-sleep" echo "" -echo "All binaries are saved to '${script_dir}/${BUILD_DIR}'" -echo "All packages are saved to '${script_dir}/pkg-*.tgz' archives" +echo "All binaries are saved to '$(pwd)/${BUILD_DIR}'" +echo "All packages are saved to '$(pwd)/pkg-*.tgz' archives" echo "" diff --git a/scripts/publish.sh b/scripts/publish.sh index 7d2190a..40fe1e1 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -15,7 +15,8 @@ publish_package() { local _arch="${3}" pl-pkg publish package \ - --package-name="common/${_bin_name}" \ + --package-id="${_bin_name}" \ + --skip-existing-packages \ --os="${_os}" \ --arch="${_arch}" printf "\n"