Giter VIP home page Giter VIP logo

Comments (5)

shaggyyy2002 avatar shaggyyy2002 commented on August 30, 2024 2

On the core repo its done.

  1. A tag when pushed and the testCI is passed (in core repo) only then it will trigger the remote distributable repo (linux, window, mac) to make the dist repo accept the req.
    (image from core repo LinuxCI)
Screenshot 2024-06-21 at 2 28 19 AM 2. Now we need to change the CI in the dist repo so that when the trigger reaches it will start the CI process of that repo

changes needed on the dist repo's

name: "MetaCall Distributable Release"

on:
  repository_dispatch:
    types: [test-trigger]

(Image from linux-dist repo)
Screenshot 2024-06-21 at 2 31 07 AM

from core.

shaggyyy2002 avatar shaggyyy2002 commented on August 30, 2024 1

using this under the release.yml file so that dispatch runs when the release.yml file is build as mentioned needs: build. if created a separate file for this it may sometimes run first or last as its picked or we would need to use if else statements, this is more easy.

name: Release

on:
  push:
    tags:
    - 'v*.*.*'

concurrency:
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
  cancel-in-progress: true

env:
  GHR_VERSION: 0.12.0
  IMAGE_NAME: index.docker.io/metacall/core
  IMAGE_REGISTRY: index.docker.io
  ARTIFACTS_PATH: ./build-artifacts
  # GITHUB_TOKEN      - From default secrets
  # GITHUB_REPOSITORY - Default variable

jobs:
  build:
    name: Build the core
    runs-on: ubuntu-latest
    steps:
      - name: Check out the repo
        uses: actions/checkout@v4
.
.
.
. [continued in core]
.
.
 dispatch:
    needs: build
    strategy:
      matrix:
        repo: ['company/repo1', 'company/repo2', 'company/repo3']
    runs-on: ubuntu-latest
    steps:
      - name: Repository Dispatch
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.ACCESS_TOKEN }}
          repository: ${{ matrix.repo }}
          event-type: test-trigger   

This is what it would look like:

Screenshot 2024-06-04 at 10 12 29 PM

from core.

shaggyyy2002 avatar shaggyyy2002 commented on August 30, 2024 1

We are not using release.yml file that often so 2 possible solution left.

  1. Create a separate yml file
name: CI Signal to other dist repos

on:
  push:
    tags:
      - 'v*'

jobs:
  check_completion:
    runs-on: ubuntu-latest
    outputs:
      {other OS}
      windows_success: ${{ steps.windows.outputs.success }}
> {Other OS checks}
      - name: Check Windows Test Completion
        id: windows
        if: github.event.workflow_run.name == 'Windows Test'
        run: |
          echo "::set-output name=success::${{ github.event.workflow_run.conclusion == 'success' }}"

  dispatch_windows:
    if: ${{ steps.check_completion.outputs.windows_success == 'true' }}
    runs-on: ubuntu-latest
    steps:
      - name: Windows Repository Dispatch
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.ACCESS_TOKEN }}
          repository: shaggyyy2002/distributable-windows
          event-type: test-trigger
  1. Add the code to the test files, so that when the test completes, it then trigger to that distributable repo eg. Windows test successful -> triggers -> dist-windows
  trigger_dist_windows:
    needs: windows-test
    if: ${{ success() }}
    runs-on: ubuntu-latest
    steps:
      - name: Windows Repository Dispatch
        uses: peter-evans/repository-dispatch@v3
        with:
          token: ${{ secrets.ACCESS_TOKEN }}
          repository: metacall/distributable-windows
          event-type: test-trigger
          ref: ${{ github.ref }}

To solve the issue, I am using the 2 one so that no need to write extra code and logic. The first one (creating a separate file) would've required us to write something to make sure our dist repo triggers when all the checks and tests are passed. So choosing the 2nd option


✅ Our commit & tag when pushed it did trigger the dist repo.
❌ The error facing right now is in the dist repo to release it, it needs a git tag, which is being passed from the core repo but its not accessible from the dist repos.

from core.

shaggyyy2002 avatar shaggyyy2002 commented on August 30, 2024 1

some minor changes: we are using client-payload: '{"ref": "${{ github.ref }}"}'
the earlier ref: ${{ github.ref }} is deprecated for v3 dispatch.
More info : https://github.com/peter-evans/repository-dispatch

from core.

shaggyyy2002 avatar shaggyyy2002 commented on August 30, 2024
Screenshot 2024-06-28 at 9 05 33 PM

from core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.