From f1d035f2e72d65e127055e332e15c5b528810913 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 4 Sep 2024 09:14:02 +0200 Subject: [PATCH 1/2] feat: login to cos --- .../actions/login-private-registry/action.yml | 17 ++++++++++++++++- .github/workflows/docker_publish.yml | 5 ++++- .github/workflows/npm_napi_publish.yml | 10 ++++++++-- .github/workflows/rust-update-dependencies.yml | 5 ++++- .github/workflows/rust_binary_publish.yml | 5 ++++- .github/workflows/rust_registry_publish.yml | 5 ++++- .github/workflows/rust_test.yml | 5 ++++- 7 files changed, 44 insertions(+), 8 deletions(-) diff --git a/.github/actions/login-private-registry/action.yml b/.github/actions/login-private-registry/action.yml index f421bdbc..bb3daa88 100644 --- a/.github/actions/login-private-registry/action.yml +++ b/.github/actions/login-private-registry/action.yml @@ -15,6 +15,15 @@ inputs: additional_private_keys: default: "" description: "Additional private keys to add to the ssh-agent" + cos_username: + default: "" + description: "Username to connect to cos" + cos_password: + default: "" + description: "Password to connect to cos" + cos_tenant: + default: "" + description: "Tenant to connect to cos" host: default: "" description: "DEPRECATED" @@ -56,10 +65,16 @@ runs: echo " insteadOf = https://github.com/orica-digital" >> $HOME/.gitconfig echo '[url "ssh://git@github.com/orica-digital"]' >> $HOME/.gitconfig echo " insteadOf = https://git@github.com/orica-digital" >> $HOME/.gitconfig - - name: Login to private registry + - name: Login to shipyard private registry shell: bash run: cargo login --registry ${{ inputs.name }} ${{ inputs.token }} + - name: Login to orica cosmos private registry + shell: bash + if: inputs.cos_username != '' && inputs.cos_password != '' && inputs.cos_tenant != '' + run: + az login --service-principal --username ${{ inputs.cos_username }} --password ${{ inputs.cos_password }} --tenant ${{ inputs.cos_tenant }} + az account get-access-token --query "join(' ', ['Bearer', accessToken])" --output tsv | cargo login --registry cos - name: Login to our private npm registry uses: actions/setup-node@v4 with: diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml index e78054dd..04822f80 100644 --- a/.github/workflows/docker_publish.yml +++ b/.github/workflows/docker_publish.yml @@ -86,12 +86,15 @@ jobs: with: toolchain: ${{ inputs.toolchain }} - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v2 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} additional_private_keys: | ${{ secrets.OREPROLIB_SSH_PRIVATE_KEY }} ${{ secrets.SPARKL_BLAST_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/npm_napi_publish.yml b/.github/workflows/npm_napi_publish.yml index f366825a..0167bf4c 100644 --- a/.github/workflows/npm_napi_publish.yml +++ b/.github/workflows/npm_napi_publish.yml @@ -67,12 +67,15 @@ jobs: - name: Git checkout uses: actions/checkout@v4 - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v2 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} - name: Build rust package uses: ForesightMiningSoftwareCorporation/github/.github/actions/build-napi-artifact@v3.0.0 @@ -129,12 +132,15 @@ jobs: run: yarn artifacts working-directory: ${{ inputs.working_directory }} - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v2 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} - name: Publish id: publish diff --git a/.github/workflows/rust-update-dependencies.yml b/.github/workflows/rust-update-dependencies.yml index 8e0af5d8..24e2e286 100644 --- a/.github/workflows/rust-update-dependencies.yml +++ b/.github/workflows/rust-update-dependencies.yml @@ -37,13 +37,16 @@ jobs: with: app_id: ${{ secrets.UPDATECLIBOT_APP_ID }} private_key: ${{ secrets.UPDATECLIBOT_APP_PRIVKEY }} - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v1 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 if: steps.check_exists.outputs.exists != 'true' with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} - name: Run UpdateCli Autodiscovery shell: bash run: | diff --git a/.github/workflows/rust_binary_publish.yml b/.github/workflows/rust_binary_publish.yml index 5fecd2b8..91b9102b 100644 --- a/.github/workflows/rust_binary_publish.yml +++ b/.github/workflows/rust_binary_publish.yml @@ -79,12 +79,15 @@ jobs: - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ inputs.toolchain }} - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v1 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} additional_private_keys: | ${{ secrets.FSE_SSH_PRIVATE_KEY }} ${{ secrets.BEVY_CLIPMAP_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/rust_registry_publish.yml b/.github/workflows/rust_registry_publish.yml index 393b4b33..c7bd100f 100644 --- a/.github/workflows/rust_registry_publish.yml +++ b/.github/workflows/rust_registry_publish.yml @@ -74,13 +74,16 @@ jobs: shell: bash run: | cargo login ${{ secrets.CARGO_PUBLIC_REGISTRY_TOKEN }} - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v1 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 if: inputs.public_release != 'true' with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} additional_private_keys: | ${{ secrets.FSE_SSH_PRIVATE_KEY }} ${{ secrets.VOLUMESIGHT_SSH_PRIVATE_KEY }} diff --git a/.github/workflows/rust_test.yml b/.github/workflows/rust_test.yml index 82cbe1bf..a16356f9 100644 --- a/.github/workflows/rust_test.yml +++ b/.github/workflows/rust_test.yml @@ -162,12 +162,15 @@ jobs: rustup set auto-self-update disable - name: Checkout uses: actions/checkout@v4 - - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v1 + - uses: ForesightMiningSoftwareCorporation/github/.github/actions/login-private-registry@v3.2.0 with: private_key: ${{ secrets.CARGO_PRIVATE_REGISTRY_SSH_PRIVATE_KEY }} host: ${{ secrets.CARGO_PRIVATE_REGISTRY_HOST }} name: ${{ secrets.CARGO_PRIVATE_REGISTRY_NAME }} token: ${{ secrets.CARGO_PRIVATE_REGISTRY_TOKEN }} + cos_username: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_USERNAME }} + cos_password: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_PASSWORD }} + cos_tenant: ${{ secrets.CARGO_COS_PRIVATE_REGISTRY_TENANT }} additional_private_keys: | ${{ secrets.FSE_SSH_PRIVATE_KEY }} ${{ secrets.BEVY_CLIPMAP_SSH_PRIVATE_KEY }} From 9b1ab345b2a83781827c190bf558db5872fb562b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFs=20Postula?= Date: Wed, 4 Sep 2024 09:19:20 +0200 Subject: [PATCH 2/2] feat: add confi of build-workflow-version --- .github/workflows/update_release_workflows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update_release_workflows.yml b/.github/workflows/update_release_workflows.yml index 56baa106..1941f200 100644 --- a/.github/workflows/update_release_workflows.yml +++ b/.github/workflows/update_release_workflows.yml @@ -31,7 +31,7 @@ jobs: else template_option="" fi - fslabscli generate-release-workflow --test-publish-required-disabled --fslabscli-version ${{ vars.FSLABSCLI_VERSION }} ${template_option} + fslabscli generate-release-workflow --test-publish-required-disabled --fslabscli-version ${{ vars.FSLABSCLI_VERSION }} --build-workflow-version ${{ vars.BUILD_WORKFLOW_VERSION }} ${template_option} - id: generate_wix_files name: Generate release wix files shell: bash