Skip to content

Commit

Permalink
chore(repo): skip console preview if not needed (#4016)
Browse files Browse the repository at this point in the history
*By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*.
  • Loading branch information
MarkMcCulloh authored Aug 30, 2023
1 parent bfbd81d commit 3721e51
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
last-version: ${{ fromJson(steps.changelog.outputs.data).lastVersion }}
changelog: ${{ fromJson(steps.changelog.outputs.data).changelog }}
vscode-wing-changed: ${{ fromJson(steps.turbo-diff.outputs.data)['vscode-wing#compile'].changes }}
console-changed: ${{ fromJson(steps.turbo-diff.outputs.data)['@wingconsole/app#preview:fly'].changes }}
e2e-changed: ${{ fromJson(steps.turbo-diff.outputs.data)['hangar#test'].changes }}
bench-changed: ${{ fromJson(steps.turbo-diff.outputs.data)['hangar#bench'].changes }}
steps:
Expand Down Expand Up @@ -272,12 +273,10 @@ jobs:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
FLY_VERSION: "0.1.80"
APP_NAME: wing-console-pr-${{github.event.number}}
if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'mergify/merge-queue/') }}
if: ${{ needs.build.outputs.console-changed == 'true' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository && !startsWith(github.head_ref, 'mergify/merge-queue/') }}
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 1

- name: Download Dist Artifacts
uses: actions/download-artifact@v3
Expand All @@ -288,7 +287,7 @@ jobs:
- name: Install flyctl
uses: superfly/flyctl-actions/[email protected]
with:
version: ${{env.FLY_VERSION}}
version: ${{ env.FLY_VERSION }}

- name: Deploy to Fly.io
id: deploy-fly
Expand Down
4 changes: 4 additions & 0 deletions apps/wing-console/console/app/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
},
"package": {
"outputs": ["../../../../dist/wingconsole-app-*.tgz"]
},
"preview:fly": {
"dependsOn": ["compile"],
"inputs": ["demo/*", "preview/*"]
}
}
}
1 change: 1 addition & 0 deletions tools/bump-pack/src/turbo-diff.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const turboArgs = [
"test",
"package",
"bench",
"preview:fly",
"--dry-run=json",
];

Expand Down

0 comments on commit 3721e51

Please sign in to comment.