From 9befa33cfd8ed2ca388dc8ab3179c8955276b502 Mon Sep 17 00:00:00 2001 From: Elad Cohen Date: Thu, 14 Mar 2024 15:02:39 +0200 Subject: [PATCH] generate workflows --- .github/workflows/canary.yaml | 42 ++++++++++++++++++++++ .github/workflows/eventbridge-pull.yaml | 4 +-- .github/workflows/eventbridge-release.yaml | 3 +- .github/workflows/lock-pull.yaml | 4 +-- .github/workflows/lock-release.yaml | 21 +++++++++-- .mergify.yml | 12 +++++++ 6 files changed, 79 insertions(+), 7 deletions(-) diff --git a/.github/workflows/canary.yaml b/.github/workflows/canary.yaml index 0b74431f..f98238b0 100644 --- a/.github/workflows/canary.yaml +++ b/.github/workflows/canary.yaml @@ -67,6 +67,27 @@ jobs: - name: Test run: wing test working-directory: checks + canary-eventbridge: + name: Test eventbridge + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: eventbridge + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: eventbridge + - name: Test + run: wing test + working-directory: eventbridge canary-fifoqueue: name: Test fifoqueue runs-on: ubuntu-latest @@ -109,6 +130,27 @@ jobs: - name: Test run: wing test working-directory: github + canary-lock: + name: Test lock + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + sparse-checkout: lock + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 20.x + registry-url: https://registry.npmjs.org + - name: Install winglang + run: npm i -g winglang + - name: Install dependencies + run: npm install --include=dev + working-directory: lock + - name: Test + run: wing test + working-directory: lock canary-ngrok: name: Test ngrok runs-on: ubuntu-latest diff --git a/.github/workflows/eventbridge-pull.yaml b/.github/workflows/eventbridge-pull.yaml index 4a133ffb..d4e97cba 100644 --- a/.github/workflows/eventbridge-pull.yaml +++ b/.github/workflows/eventbridge-pull.yaml @@ -4,7 +4,7 @@ on: paths: - eventbridge/** jobs: - build: + build-eventbridge: runs-on: ubuntu-latest steps: - name: Checkout @@ -14,7 +14,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x registry-url: https://registry.npmjs.org - name: Install winglang run: npm i -g winglang diff --git a/.github/workflows/eventbridge-release.yaml b/.github/workflows/eventbridge-release.yaml index 27a30d68..1c40e6e9 100644 --- a/.github/workflows/eventbridge-release.yaml +++ b/.github/workflows/eventbridge-release.yaml @@ -5,8 +5,9 @@ on: - main paths: - eventbridge/** + - "!eventbridge/package-lock.json" jobs: - build: + build-eventbridge: runs-on: ubuntu-latest steps: - name: Checkout diff --git a/.github/workflows/lock-pull.yaml b/.github/workflows/lock-pull.yaml index 8f41b4d3..ae31af7d 100644 --- a/.github/workflows/lock-pull.yaml +++ b/.github/workflows/lock-pull.yaml @@ -4,7 +4,7 @@ on: paths: - lock/** jobs: - build: + build-lock: runs-on: ubuntu-latest steps: - name: Checkout @@ -14,7 +14,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x registry-url: https://registry.npmjs.org - name: Install winglang run: npm i -g winglang diff --git a/.github/workflows/lock-release.yaml b/.github/workflows/lock-release.yaml index 3c45344d..55210ab4 100644 --- a/.github/workflows/lock-release.yaml +++ b/.github/workflows/lock-release.yaml @@ -5,8 +5,9 @@ on: - main paths: - lock/** + - "!lock/package-lock.json" jobs: - build: + build-lock: runs-on: ubuntu-latest steps: - name: Checkout @@ -16,7 +17,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v3 with: - node-version: 18.x + node-version: 20.x registry-url: https://registry.npmjs.org - name: Install winglang run: npm i -g winglang @@ -29,9 +30,25 @@ jobs: - name: Pack run: wing pack working-directory: lock + - name: Get package version + run: echo WINGLIB_VERSION=$(node -p "require('./package.json').version") >> + "$GITHUB_ENV" + working-directory: lock - name: Publish run: npm publish --access=public --registry https://registry.npmjs.org --tag latest *.tgz working-directory: lock env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: Tag commit + uses: tvdias/github-tagger@v0.0.1 + with: + repo-token: ${{ secrets.PROJEN_GITHUB_TOKEN }} + tag: lock-v${{ env.WINGLIB_VERSION }} + - name: GitHub release + uses: softprops/action-gh-release@v1 + with: + name: lock v${{ env.WINGLIB_VERSION }} + tag_name: lock-v${{ env.WINGLIB_VERSION }} + files: "*.tgz" + token: ${{ secrets.PROJEN_GITHUB_TOKEN }} diff --git a/.mergify.yml b/.mergify.yml index 883ffa44..964c4fc8 100644 --- a/.mergify.yml +++ b/.mergify.yml @@ -44,12 +44,18 @@ pull_request_rules: - -check-failure=build-containers - -check-pending=build-containers - -check-stale=build-containers + - -check-failure=build-eventbridge + - -check-pending=build-eventbridge + - -check-stale=build-eventbridge - -check-failure=build-fifoqueue - -check-pending=build-fifoqueue - -check-stale=build-fifoqueue - -check-failure=build-github - -check-pending=build-github - -check-stale=build-github + - -check-failure=build-lock + - -check-pending=build-lock + - -check-stale=build-lock - -check-failure=build-ngrok - -check-pending=build-ngrok - -check-stale=build-ngrok @@ -95,12 +101,18 @@ pull_request_rules: - -check-failure=build-containers - -check-pending=build-containers - -check-stale=build-containers + - -check-failure=build-eventbridge + - -check-pending=build-eventbridge + - -check-stale=build-eventbridge - -check-failure=build-fifoqueue - -check-pending=build-fifoqueue - -check-stale=build-fifoqueue - -check-failure=build-github - -check-pending=build-github - -check-stale=build-github + - -check-failure=build-lock + - -check-pending=build-lock + - -check-stale=build-lock - -check-failure=build-ngrok - -check-pending=build-ngrok - -check-stale=build-ngrok