From 437691cc9e7badc74f09ee8bf2bf1ad23e7ec0a3 Mon Sep 17 00:00:00 2001 From: fynnbe Date: Thu, 23 May 2024 10:43:37 +0200 Subject: [PATCH] update publish wf --- .github/workflows/build.yaml | 12 ++++------ .github/workflows/publish.yaml | 9 ++------ .github/workflows/publish_call.yaml | 36 ++++++++++------------------- 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3387407e..d85c6aa6 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -51,22 +51,18 @@ jobs: needs: generate-initial-collection-json uses: bioimage-io/collection/.github/workflows/stage_call.yaml@main with: - resource_id: 'frank-water-buffalo' + concept_id: 'frank-water-buffalo' package_url: 'https://uk1s3.embassy.ebi.ac.uk/public-datasets/examples.bioimage.io/frank-water-buffalo_v1.zip' environment_name: testing - secrets: inherit + secrets: inherit test-publish: needs: test-stage uses: bioimage-io/collection/.github/workflows/publish_call.yaml@main with: - resource_id: ${{vars.TEST_PACKAGE_ID}} # testing! - stage_number: 1 + concept_id: 'frank-water-buffalo' reviewer: 'github|${{github.actor_id}}' - S3_HOST: ${{vars.S3_HOST}} - S3_BUCKET: ${{vars.S3_TEST_BUCKET}} # testing! - S3_FOLDER: ${{vars.S3_TEST_FOLDER}}/ci # testing! - REVIEWERS: ${{vars.REVIEWERS}} + environment_name: testing secrets: inherit test-generate-collection-json: diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7a208a8b..ca5ff08f 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -31,12 +31,7 @@ # call: # uses: bioimage-io/collection/.github/workflows/publish_call.yaml@main # with: -# resource_id: ${{inputs.resource_id}} -# stage_number: ${{fromJson(inputs.stage_number)}} # wo 'fromJson' the number is given as string, see https://github.com/orgs/community/discussions/67182 +# concept_id: ${{inputs.resource_id}} # reviewer: ${{inputs.reviewer == 'auto detect' && format('github|{0}', github.actor_id) || inputs.reviewer}} -# S3_HOST: ${{vars.S3_HOST}} -# S3_BUCKET: ${{vars.S3_BUCKET}} -# S3_FOLDER: ${{inputs.sandbox && vars.S3_SANDBOX_FOLDER || vars.S3_FOLDER}} -# REVIEWERS: ${{vars.REVIEWERS}} - +# environment_name: ${{inputs.sandbox && vars.S3_SANDBOX_FOLDER || vars.S3_FOLDER}} # secrets: inherit diff --git a/.github/workflows/publish_call.yaml b/.github/workflows/publish_call.yaml index 79eae145..e3ff7fac 100644 --- a/.github/workflows/publish_call.yaml +++ b/.github/workflows/publish_call.yaml @@ -3,46 +3,30 @@ name: publish call on: workflow_call: inputs: - resource_id: - description: "Bioimageio ID of the resource - to be used to access the resource on S3" + concept_id: + description: "Bioimageio resource concept" required: true type: string - stage_number: - description: stage number to publish - required: true - type: number reviewer: description: GitHub user id (prefixed with 'github|') of the bioimage.io maintainer accepting this resource version required: false default: 'github|${{github.actor_id}}' type: string - S3_HOST: - required: true - type: string - S3_BUCKET: + environment_name: required: true type: string - S3_FOLDER: - required: true - type: string - REVIEWERS: - required: true - type: string - -concurrency: ${{inputs.resource_id}}-call +concurrency: ${{inputs.environment_name}}-${{inputs.concept_id}}-call env: - S3_HOST: ${{inputs.S3_HOST}} - S3_BUCKET: ${{inputs.S3_BUCKET}} - S3_FOLDER: ${{inputs.S3_FOLDER}} - S3_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY_ID}} + S3_HOST: ${{vars.S3_HOST}} + S3_BUCKET: ${{vars.S3_BUCKET}} S3_SECRET_ACCESS_KEY: ${{secrets.S3_SECRET_ACCESS_KEY}} - ZENODO_API_ACCESS_TOKEN: ${{secrets.ZENODO_API_ACCESS_TOKEN}} - REVIEWERS: ${{inputs.REVIEWERS}} + S3_ACCESS_KEY_ID: ${{secrets.S3_ACCESS_KEY_ID}} RUN_URL: ${{github.server_url}}/${{github.repository}}/actions/runs/${{github.run_id}} MAIL_PASSWORD: ${{secrets.MAIL_PASSWORD}} + jobs: run: runs-on: ubuntu-latest @@ -57,3 +41,7 @@ jobs: cache: "pip" # caching pip dependencies - run: pip install . - run: backoffice publish "${{inputs.resource_id}}" "staged/${{inputs.stage_number}}" "${{inputs.reviewer}}" + env: + S3_FOLDER: ${{vars.S3_FOLDER}} + ZENODO_URL: ${{vars.ZENODO_URL}} + ZENODO_API_ACCESS_TOKEN: ${{secrets.ZENODO_API_ACCESS_TOKEN}}