Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(ci): fix canary publish on main #17374

Merged
merged 1 commit into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions .github/workflows/ci.generate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,6 @@ const installDenoStep = {

const authenticateWithGoogleCloud = {
name: "Authenticate with Google Cloud",
if: [
"matrix.profile == 'release' &&",
"matrix.job == 'test' &&",
"github.repository == 'denoland/deno' &&",
"(github.ref == 'refs/heads/main' ||",
"startsWith(github.ref, 'refs/tags/'))",
].join("\n"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better for the conditions to not be in the re-usable objects.

uses: "google-github-actions/auth@v1",
with: {
"project_id": "denoland",
Expand Down Expand Up @@ -335,7 +328,16 @@ const ci = {
if: "matrix.job == 'bench'",
...installNodeStep,
},
authenticateWithGoogleCloud,
{
if: [
"matrix.profile == 'release' &&",
"matrix.job == 'test' &&",
"github.repository == 'denoland/deno' &&",
"(github.ref == 'refs/heads/main' ||",
"startsWith(github.ref, 'refs/tags/'))",
].join("\n"),
...authenticateWithGoogleCloud,
},
{
name: "Setup gcloud (unix)",
if: [
Expand All @@ -355,8 +357,8 @@ const ci = {
name: "Setup gcloud (windows)",
if: [
"runner.os == 'Windows' &&",
"matrix.job == 'test' &&",
"matrix.profile == 'release' &&",
"matrix.job == 'test' &&",
"github.repository == 'denoland/deno' &&",
"(github.ref == 'refs/heads/main' ||",
"startsWith(github.ref, 'refs/tags/'))",
Expand Down
12 changes: 3 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18
- name: Authenticate with Google Cloud
if: |-
- if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/tags/'))))
name: Authenticate with Google Cloud
uses: google-github-actions/auth@v1
with:
project_id: denoland
Expand All @@ -154,8 +154,8 @@ jobs:
- name: Setup gcloud (windows)
if: |-
!(github.event_name == 'pull_request' && matrix.skip_pr) && (steps.exit_early.outputs.EXIT_EARLY != 'true' && (runner.os == 'Windows' &&
matrix.job == 'test' &&
matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/tags/'))))
Expand Down Expand Up @@ -552,12 +552,6 @@ jobs:
if: github.repository == 'denoland/deno' && github.ref == 'refs/heads/main'
steps:
- name: Authenticate with Google Cloud
if: |-
matrix.profile == 'release' &&
matrix.job == 'test' &&
github.repository == 'denoland/deno' &&
(github.ref == 'refs/heads/main' ||
startsWith(github.ref, 'refs/tags/'))
uses: google-github-actions/auth@v1
with:
project_id: denoland
Expand Down