diff --git a/.github/workflows/nightly_build.yaml b/.github/workflows/nightly_build.yaml new file mode 100644 index 00000000..20c14a2e --- /dev/null +++ b/.github/workflows/nightly_build.yaml @@ -0,0 +1,322 @@ +name: Build nightly artifacts + +on: + schedule: + # 17:00 Asia/Kolkata (11:30 UTC) + - cron: '30 11 * * *' + workflow_dispatch: + inputs: + test_mode: + description: Allow manual runs from non-main branches for workflow testing + required: false + default: "false" + type: choice + options: + - "false" + - "true" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + prepare-nightly-version: + runs-on: ubuntu-latest + permissions: + contents: write + if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true') + outputs: + should_build: ${{ steps.version.outputs.should_build }} + version: ${{ steps.version.outputs.version }} + tracking_tag: ${{ steps.version.outputs.tracking_tag }} + build_sha: ${{ steps.version.outputs.build_sha }} + last_nightly_tag: ${{ steps.version.outputs.last_nightly_tag }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Compute nightly version + id: version + shell: bash + run: | + set -euo pipefail + + git fetch origin main --tags --force + + is_branch_test="false" + if [ "${{ github.ref }}" != "refs/heads/main" ] && [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_mode }}" = "true" ]; then + is_branch_test="true" + fi + + last_nightly_tag=$(git for-each-ref refs/tags --sort=-creatordate --format='%(refname:short)' \ + | grep -E '^nightly-v[0-9]+\.[0-9]+\.[0-9]+-nightly\.[0-9]{8}\.[0-9a-f]+$' \ + | head -n 1 || true) + + if [ "${is_branch_test}" = "true" ]; then + new_commits=1 + should_create_tracking_tag="false" + else + should_create_tracking_tag="true" + if [ -n "${last_nightly_tag}" ]; then + last_nightly_commit=$(git rev-list -n 1 "${last_nightly_tag}") + new_commits=$(git rev-list --count "${last_nightly_commit}..origin/main") + else + new_commits=$(git rev-list --count origin/main) + fi + fi + + if [ "${new_commits}" -eq 0 ]; then + echo 'should_build=false' >> "$GITHUB_OUTPUT" + echo 'version=' >> "$GITHUB_OUTPUT" + echo 'tracking_tag=' >> "$GITHUB_OUTPUT" + echo 'build_sha=' >> "$GITHUB_OUTPUT" + echo "last_nightly_tag=${last_nightly_tag}" >> "$GITHUB_OUTPUT" + echo "should_create_tracking_tag=${should_create_tracking_tag}" >> "$GITHUB_OUTPUT" + exit 0 + fi + + stable_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true) + if [ -z "${stable_tag}" ]; then + stable_tag='v0.0.0' + fi + + stable_version=${stable_tag#v} + IFS='.' read -r major minor patch <<< "${stable_version}" + next_patch=$((patch + 1)) + base_version="${major}.${minor}.${next_patch}" + + if [ "${is_branch_test}" = "true" ]; then + build_sha="${{ github.sha }}" + else + build_sha=$(git rev-parse origin/main) + fi + short_sha=$(git rev-parse --short=12 "${build_sha}") + nightly_date=$(TZ=Asia/Kolkata date +%Y%m%d) + version="${base_version}-nightly.${nightly_date}.${short_sha}" + tracking_tag="nightly-v${version}" + + if [ "${is_branch_test}" = "true" ]; then + version="${base_version}-nightly.${nightly_date}.${short_sha}.test" + tracking_tag="test-nightly-v${version}" + fi + + echo 'should_build=true' >> "$GITHUB_OUTPUT" + echo "version=${version}" >> "$GITHUB_OUTPUT" + echo "tracking_tag=${tracking_tag}" >> "$GITHUB_OUTPUT" + echo "build_sha=${build_sha}" >> "$GITHUB_OUTPUT" + echo "last_nightly_tag=${last_nightly_tag}" >> "$GITHUB_OUTPUT" + echo "should_create_tracking_tag=${should_create_tracking_tag}" >> "$GITHUB_OUTPUT" + + - name: Create nightly tracking tag + if: steps.version.outputs.should_build == 'true' && steps.version.outputs.should_create_tracking_tag == 'true' + shell: bash + run: | + set -euo pipefail + + tracking_tag="${{ steps.version.outputs.tracking_tag }}" + build_sha="${{ steps.version.outputs.build_sha }}" + + if git rev-parse "${tracking_tag}" >/dev/null 2>&1; then + echo "Tracking tag ${tracking_tag} already exists" + exit 0 + fi + + git config user.email 'airborne_bot@juspay.in' + git config user.name 'Airborne Bot' + git tag "${tracking_tag}" "${build_sha}" + git push origin "${tracking_tag}" + + server-docker-build: + needs: prepare-nightly-version + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-nightly-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push server image + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: airborne_server/Dockerfile + tags: ghcr.io/${{ github.repository }}-server:${{ needs.prepare-nightly-version.outputs.version }}-${{ matrix.tag }} + + server-create-manifest: + needs: [prepare-nightly-version, server-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create server manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-server:${{ needs.prepare-nightly-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-server:${{ needs.prepare-nightly-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-server:${{ needs.prepare-nightly-version.outputs.version }}-linux-arm64 + + analytics-docker-build: + needs: [prepare-nightly-version] + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-nightly-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push analytics image + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: airborne_analytics_server/Dockerfile + tags: ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-nightly-version.outputs.version }}-${{ matrix.tag }} + + analytics-create-manifest: + needs: [prepare-nightly-version, analytics-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create analytics manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-nightly-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-nightly-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-nightly-version.outputs.version }}-linux-arm64 + + dashboard-docker-build: + needs: [prepare-nightly-version] + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-nightly-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push dashboard image + uses: docker/build-push-action@v6 + with: + push: true + context: ./airborne_dashboard + file: ./airborne_dashboard/Dockerfile + tags: ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-nightly-version.outputs.version }}-${{ matrix.tag }} + + dashboard-create-manifest: + needs: [prepare-nightly-version, dashboard-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-nightly-version.outputs.should_build == 'true' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create dashboard manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-nightly-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-nightly-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-nightly-version.outputs.version }}-linux-arm64 diff --git a/.github/workflows/prerelease_on_merge.yaml b/.github/workflows/prerelease_on_merge.yaml new file mode 100644 index 00000000..3e242a8c --- /dev/null +++ b/.github/workflows/prerelease_on_merge.yaml @@ -0,0 +1,287 @@ +name: Build prerelease artifacts on PR merge + +on: + pull_request: + types: [closed] + branches: [main] + workflow_dispatch: + inputs: + test_mode: + description: Allow manual runs from non-main branches for workflow testing + required: false + default: "false" + type: choice + options: + - "false" + - "true" + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.merge_commit_sha || github.run_id }} + cancel-in-progress: true + +jobs: + prepare-prerelease-version: + runs-on: ubuntu-latest + permissions: + contents: write + if: (github.event_name == 'pull_request' && github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'main') || (github.event_name == 'workflow_dispatch' && (github.ref == 'refs/heads/main' || github.event.inputs.test_mode == 'true')) + outputs: + version: ${{ steps.version.outputs.version }} + tracking_tag: ${{ steps.version.outputs.tracking_tag }} + build_sha: ${{ steps.version.outputs.build_sha }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Compute prerelease version + id: version + shell: bash + run: | + set -euo pipefail + + git fetch origin main --tags --force + + stable_tag=$(git tag | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1 || true) + if [ -z "${stable_tag}" ]; then + stable_tag="v0.0.0" + fi + + stable_version=${stable_tag#v} + IFS='.' read -r major minor patch <<< "${stable_version}" + next_patch=$((patch + 1)) + base_version="${major}.${minor}.${next_patch}" + + build_sha="${{ github.event.pull_request.merge_commit_sha }}" + if [ -z "${build_sha}" ]; then + build_sha="${{ github.sha }}" + fi + + short_sha=$(git rev-parse --short=12 "${build_sha}") + version="${base_version}-${short_sha}" + tracking_tag="prerelease-v${version}" + should_create_tracking_tag="true" + + if [ "${{ github.ref }}" != "refs/heads/main" ] && [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_mode }}" = "true" ]; then + version="${base_version}-${short_sha}.test" + tracking_tag="test-prerelease-v${version}" + should_create_tracking_tag="false" + fi + + echo "version=${version}" >> "$GITHUB_OUTPUT" + echo "tracking_tag=${tracking_tag}" >> "$GITHUB_OUTPUT" + echo "build_sha=${build_sha}" >> "$GITHUB_OUTPUT" + echo "should_create_tracking_tag=${should_create_tracking_tag}" >> "$GITHUB_OUTPUT" + + - name: Create prerelease tracking tag + if: steps.version.outputs.should_create_tracking_tag == 'true' + shell: bash + run: | + set -euo pipefail + + tracking_tag="${{ steps.version.outputs.tracking_tag }}" + build_sha="${{ steps.version.outputs.build_sha }}" + + if git rev-parse "${tracking_tag}" >/dev/null 2>&1; then + echo "Tracking tag ${tracking_tag} already exists" + exit 0 + fi + + git config user.email "airborne_bot@juspay.in" + git config user.name "Airborne Bot" + git tag "${tracking_tag}" "${build_sha}" + git push origin "${tracking_tag}" + + server-docker-build: + needs: prepare-prerelease-version + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-prerelease-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push server image + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: airborne_server/Dockerfile + tags: ghcr.io/${{ github.repository }}-server:${{ needs.prepare-prerelease-version.outputs.version }}-${{ matrix.tag }} + + server-create-manifest: + needs: [prepare-prerelease-version, server-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create server manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-server:${{ needs.prepare-prerelease-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-server:${{ needs.prepare-prerelease-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-server:${{ needs.prepare-prerelease-version.outputs.version }}-linux-arm64 + + analytics-docker-build: + needs: [prepare-prerelease-version] + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-prerelease-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push analytics image + uses: docker/build-push-action@v6 + with: + push: true + context: . + file: airborne_analytics_server/Dockerfile + tags: ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-prerelease-version.outputs.version }}-${{ matrix.tag }} + + analytics-create-manifest: + needs: [prepare-prerelease-version, analytics-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create analytics manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-prerelease-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-prerelease-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-analytics-server:${{ needs.prepare-prerelease-version.outputs.version }}-linux-arm64 + + dashboard-docker-build: + needs: [prepare-prerelease-version] + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + strategy: + max-parallel: 5 + matrix: + include: + - platform: linux/amd64 + tag: linux-amd64 + os: ubuntu-latest + - platform: linux/arm64 + tag: linux-arm64 + os: ubuntu-24.04-arm + runs-on: ${{ matrix.os }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ needs.prepare-prerelease-version.outputs.build_sha }} + fetch-depth: 0 + ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY }} + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Build and push dashboard image + uses: docker/build-push-action@v6 + with: + push: true + context: ./airborne_dashboard + file: ./airborne_dashboard/Dockerfile + tags: ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-prerelease-version.outputs.version }}-${{ matrix.tag }} + + dashboard-create-manifest: + needs: [prepare-prerelease-version, dashboard-docker-build] + permissions: + contents: read + packages: write + if: needs.prepare-prerelease-version.outputs.version != '' + runs-on: ubuntu-latest + steps: + - name: Log in to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Create dashboard manifest for multi-arch image + run: | + docker buildx imagetools create --tag ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-prerelease-version.outputs.version }} \ + ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-prerelease-version.outputs.version }}-linux-amd64 \ + ghcr.io/${{ github.repository }}-dashboard:${{ needs.prepare-prerelease-version.outputs.version }}-linux-arm64 diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 2c9da19e..4cd0daee 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,9 +1,16 @@ -name: Create an airborne release +name: Create an airborne stable release on: - pull_request: - types: [closed] - branches: [main] + workflow_dispatch: + inputs: + test_mode: + description: Allow dry testing from non-main branches (skips publish jobs and pushes) + required: false + default: "false" + type: choice + options: + - "false" + - "true" concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -15,10 +22,11 @@ jobs: permissions: contents: write id-token: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' + if: github.ref == 'refs/heads/main' || (github.event_name == 'workflow_dispatch' && github.event.inputs.test_mode == 'true') outputs: version: ${{ steps.git_tag.outputs.version }} is_new_version: ${{ steps.git_tag.outputs.is_new_version }} + is_test_mode: ${{ steps.run_mode.outputs.is_test_mode }} steps: - name: Checkout repository uses: actions/checkout@v4 @@ -26,6 +34,16 @@ jobs: fetch-depth: 0 ssh-key: ${{ secrets.AIRBORNE_DEPLOY_KEY}} + - name: Determine run mode + id: run_mode + shell: bash + run: | + if [ "${{ github.ref }}" != "refs/heads/main" ] && [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ github.event.inputs.test_mode }}" = "true" ]; then + echo "is_test_mode=true" >> "$GITHUB_OUTPUT" + else + echo "is_test_mode=false" >> "$GITHUB_OUTPUT" + fi + - name: Install Rust uses: dtolnay/rust-toolchain@master with: @@ -93,7 +111,7 @@ jobs: - name: Push code to main shell: bash - if: steps.git_tag.outputs.is_new_version == 'true' + if: steps.git_tag.outputs.is_new_version == 'true' && steps.run_mode.outputs.is_test_mode != 'true' run: | git push origin main git push origin --tags @@ -103,7 +121,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' strategy: max-parallel: 5 matrix: @@ -146,7 +164,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -178,7 +196,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' strategy: max-parallel: 5 matrix: @@ -221,7 +239,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -253,7 +271,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' strategy: max-parallel: 5 matrix: @@ -296,7 +314,7 @@ jobs: permissions: contents: read packages: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' runs-on: ubuntu-latest steps: - name: Checkout repository @@ -328,7 +346,7 @@ jobs: permissions: contents: read id-token: write - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' runs-on: ubuntu-latest env: VERSION: ${{ needs.tag-release.outputs.version }} @@ -389,7 +407,7 @@ jobs: publish-to-npm: needs: [tag-release] - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' permissions: contents: read id-token: write @@ -449,7 +467,7 @@ jobs: publish-to-npm, ] runs-on: ubuntu-latest - if: github.event.pull_request.merged == true && github.ref == 'refs/heads/main' && needs.tag-release.outputs.is_new_version == 'true' + if: needs.tag-release.outputs.is_new_version == 'true' && needs.tag-release.outputs.is_test_mode != 'true' steps: - name: Checkout repository uses: actions/checkout@v4