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

Fix boolean condition in publish.yaml #163

Merged
merged 4 commits into from
Sep 10, 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
4 changes: 2 additions & 2 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.number }}
PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}"
run: dart pub global run firehose --validate ${{ inputs.use-flutter && '--use-flutter' || '--no-use-flutter' }}
run: dart pub global run firehose --validate ${{ fromJSON('{"true":"--use-flutter","false":"--no-use-flutter"}')[inputs.use-flutter] }}

publish:
if: ${{ github.event_name == 'push' }}
Expand Down Expand Up @@ -124,4 +124,4 @@ jobs:
run: dart pub global activate firehose

- name: Publish packages
run: dart pub global run firehose --publish ${{ inputs.use-flutter && '--use-flutter' || '--no-use-flutter' }}
run: dart pub global run firehose --publish ${{ fromJSON('{"true":"--use-flutter","false":"--no-use-flutter"}')[inputs.use-flutter] }}
7 changes: 5 additions & 2 deletions .github/workflows/publish_internal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
push:
tags: [ '[A-z]+-v[0-9]+.[0-9]+.[0-9]+' ]

env:
use-flutter: false

jobs:
publish:
if: github.repository_owner == 'dart-lang'
Expand All @@ -37,8 +40,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ISSUE_NUMBER: ${{ github.event.number }}
PR_LABELS: "${{ join(github.event.pull_request.labels.*.name) }}"
run: dart pkgs/firehose/bin/firehose.dart --validate
run: dart pkgs/firehose/bin/firehose.dart --validate ${{ fromJSON('{"true":"--use-flutter","false":"--no-use-flutter"}')[env.use-flutter] }}
Copy link
Member

Choose a reason for hiding this comment

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

Why is this necessary if env is always false?

Copy link
Member

@HosseinYousefi HosseinYousefi Sep 5, 2023

Choose a reason for hiding this comment

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

Ah nevermind, the publish internal is for testing the trick.

I've seen the first commit test. Weird that the && doesn't work!


- name: Publish tagged package
if: ${{ github.event_name == 'push' }}
run: dart pkgs/firehose/bin/firehose.dart --publish
run: dart pkgs/firehose/bin/firehose.dart --publish ${{ fromJSON('{"true":"--use-flutter","false":"--no-use-flutter"}')[env.use-flutter] }}