From b41d042a39ce1b7ac4d85adc3a33478a076075b5 Mon Sep 17 00:00:00 2001 From: Imamuzzaki Abu Salam Date: Fri, 20 Sep 2024 16:25:11 +0700 Subject: [PATCH] Refactor image tag generation for bun-node-puppeteer images --- .../workflows/release-bun-node-puppeteer.yaml | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-bun-node-puppeteer.yaml b/.github/workflows/release-bun-node-puppeteer.yaml index 6dc9c73..5bffee4 100644 --- a/.github/workflows/release-bun-node-puppeteer.yaml +++ b/.github/workflows/release-bun-node-puppeteer.yaml @@ -10,16 +10,16 @@ on: inputs: release_tag: description: "Tag for the images (e.g.: beta)" - required: true + required: false apify_version: description: "Apify SDK version (e.g.: ^1.0.0)" - required: true + required: false crawlee_version: description: "Crawlee version (e.g.: ^1.0.0)" - required: true + required: false puppeteer_version: description: "Puppeteer version (e.g.: 5.5.0)" - required: true + required: false is_latest_browser_image: description: If this is a release of the latest browser image. This gets autofilled by CI in crawlee type: boolean @@ -35,7 +35,7 @@ on: pull_request: env: - RELEASE_TAG: ${{ github.event.inputs.release_tag || github.event.client_payload.release_tag || 'CI_TEST' }} + RELEASE_TAG: ${{ github.event.inputs.release_tag || github.event.client_payload.release_tag || 'latest' }} APIFY_VERSION: ${{ github.event.inputs.apify_version || github.event.client_payload.apify_version }} CRAWLEE_VERSION: ${{ github.event.inputs.crawlee_version || github.event.client_payload.crawlee_version }} PUPPETEER_VERSION: ${{ github.event.inputs.puppeteer_version || github.event.client_payload.puppeteer_version }} @@ -96,6 +96,21 @@ jobs: retry_wait_seconds: 60 # wait between retries command: cd ${{ matrix.image-name }} && npm i --dry-run + - name: Set APIFY_VERSION + # Only run if the input is not set + if: github.event.inputs.apify_version == null + run: echo "APIFY_VERSION=$(npm view apify version)" >> $GITHUB_ENV + + - name: Set CRAWLEE_VERSION + # Only run if the input is not set + if: github.event.inputs.crawlee_version == null + run: echo "CRAWLEE_VERSION=$(npm view crawlee version)" >> $GITHUB_ENV + + - name: Set PUPPETEER_VERSION + # Only run if the input is not set + if: github.event.inputs.puppeteer_version == null + run: echo "PUPPETEER_VERSION=$(npm view puppeteer version)" >> $GITHUB_ENV + - name: Build and tag image uses: docker/build-push-action@v5 with: