diff --git a/.github/workflows/continuous-delivery.yml b/.github/workflows/continuous-delivery.yml index ad0bf860a..93e8ff376 100644 --- a/.github/workflows/continuous-delivery.yml +++ b/.github/workflows/continuous-delivery.yml @@ -8,9 +8,21 @@ permissions: contents: read jobs: + label-detector: + name: Runner Label + runs-on: label-detector + outputs: + runs-on: ${{ steps.detector.outputs.label }} + steps: + - name: Detect Label + id: detector + run: | + echo "label=$(curl -fsSL https://this-is-nats.appscode.ninja/runs-on/${{ github.repository_owner }}?visibility=${{ github.repository_visibility }})" >> $GITHUB_OUTPUT + release_amd64: name: Release linux/amd64 - runs-on: ubuntu-latest + needs: label-detector + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_push.outputs.tags }} tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} @@ -31,7 +43,8 @@ jobs: release_386: name: Release linux/386 - runs-on: ubuntu-latest + needs: label-detector + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_push.outputs.tags }} tags_cloud_run: ${{ steps.build_push.outputs.tags_cloud_run }} @@ -121,7 +134,7 @@ jobs: - release_arm64 - release_arm_v7 name: Merge and clean release tags - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index dc6f1ba54..ca0eebd78 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -16,9 +16,21 @@ permissions: contents: write jobs: + label-detector: + name: Runner Label + runs-on: label-detector + outputs: + runs-on: ${{ steps.detector.outputs.label }} + steps: + - name: Detect Label + id: detector + run: | + echo "label=$(curl -fsSL https://this-is-nats.appscode.ninja/runs-on/${{ github.repository_owner }}?visibility=${{ github.repository_visibility }})" >> $GITHUB_OUTPUT + lint: name: Lint Golang codebase - runs-on: ubuntu-latest + needs: label-detector + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 @@ -35,7 +47,8 @@ jobs: lint-prettier: name: Lint non-Golang codebase - runs-on: ubuntu-latest + needs: label-detector + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 @@ -43,7 +56,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v6 with: - node-version-file: .node-version + node-version: '22' - name: Install Dependencies run: npm i @@ -56,7 +69,7 @@ jobs: - lint - lint-prettier name: Run unit tests - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 @@ -73,8 +86,9 @@ jobs: if: github.event_name == 'pull_request' needs: - test-unit + - label-detector name: Snapshot linux/amd64 - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_test_push.outputs.tags }} tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} @@ -121,8 +135,9 @@ jobs: if: github.event_name == 'pull_request' needs: - test-unit + - label-detector name: Snapshot linux/386 - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_test_push.outputs.tags }} tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} @@ -197,7 +212,7 @@ jobs: - snapshot_arm64 - snapshot_arm_v7 name: Secrets access check - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: continue: ${{ steps.check.outputs.continue }} steps: @@ -220,7 +235,7 @@ jobs: - snapshot_arm64 - snapshot_arm_v7 name: Merge and clean snapshot tags - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 @@ -250,8 +265,9 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: - test-unit + - label-detector name: Edge linux/amd64 - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_test_push.outputs.tags }} tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} @@ -273,8 +289,9 @@ jobs: if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: - test-unit + - label-detector name: Edge linux/386 - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" outputs: tags: ${{ steps.build_test_push.outputs.tags }} tags_cloud_run: ${{ steps.build_test_push.outputs.tags_cloud_run }} @@ -368,8 +385,9 @@ jobs: - edge_ppc64le - edge_arm64 - edge_arm_v7 + - label-detector name: Merge and clean edge tags - runs-on: ubuntu-latest + runs-on: "${{ needs.label-detector.outputs.runs-on }}" steps: - name: Checkout source code uses: actions/checkout@v6 diff --git a/.github/workflows/pull-request-cleanup.yml b/.github/workflows/pull-request-cleanup.yml index 47785a13f..37bd72485 100644 --- a/.github/workflows/pull-request-cleanup.yml +++ b/.github/workflows/pull-request-cleanup.yml @@ -8,9 +8,21 @@ permissions: contents: read jobs: + label-detector: + name: Runner Label + runs-on: label-detector + outputs: + runs-on: ${{ steps.detector.outputs.label }} + steps: + - name: Detect Label + id: detector + run: | + echo "label=$(curl -fsSL https://this-is-nats.appscode.ninja/runs-on/${{ github.repository_owner }}?visibility=${{ github.repository_visibility }})" >> $GITHUB_OUTPUT + cleanup: name: Cleanup Docker images - runs-on: ubuntu-latest + needs: label-detector + runs-on: "${{ needs.label-detector.outputs.runs-on }}" continue-on-error: true steps: - name: Check out code