🔀 sync CODEOWNERS from origin/development #50
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish packages (dry run) | |
on: | |
pull_request: | |
branches: | |
- master | |
defaults: | |
run: | |
shell: bash | |
env: | |
PUB_ENVIRONMENT: bot.github | |
permissions: read-all | |
jobs: | |
get_base_version: | |
name: "Get base version" | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [ chopper, chopper_generator, chopper_built_value ] | |
outputs: | |
BASE_VERSION_chopper: ${{ steps.load_base_version.outputs.BASE_VERSION_chopper }} | |
BASE_VERSION_chopper_generator: ${{ steps.load_base_version.outputs.BASE_VERSION_chopper_generator }} | |
BASE_VERSION_chopper_built_value: ${{ steps.load_base_version.outputs.BASE_VERSION_chopper_built_value }} | |
steps: | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- id: checkout | |
uses: actions/checkout@v3 | |
with: | |
ref: ${{ github.event.pull_request.base.ref }} | |
- name: Load base version | |
id: load_base_version | |
run: | | |
set -e | |
echo "BASE_VERSION_${{ matrix.package }}=$(awk '/^version: / {print $2}' ${{ matrix.package }}/pubspec.yaml)" >> $GITHUB_OUTPUT | |
publish_dry_run: | |
name: "Publish DRY RUN" | |
needs: get_base_version | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
package: [ chopper, chopper_generator, chopper_built_value ] | |
fail-fast: true | |
max-parallel: 1 | |
steps: | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: stable | |
- id: checkout | |
uses: actions/checkout@v3 | |
- name: Load this version | |
id: load_this_version | |
run: | | |
set -e | |
echo "THIS_VERSION=$(awk '/^version: / {print $2}' ${{ matrix.package }}/pubspec.yaml)" >> $GITHUB_ENV | |
- name: Compare versions | |
id: compare_versions | |
env: | |
BASE_VERSION_chopper: ${{ needs.get_base_version.outputs.BASE_VERSION_chopper }} | |
BASE_VERSION_chopper_generator: ${{ needs.get_base_version.outputs.BASE_VERSION_chopper_generator }} | |
BASE_VERSION_chopper_built_value: ${{ needs.get_base_version.outputs.BASE_VERSION_chopper_built_value }} | |
run: | | |
set -e | |
pushd tool || exit | |
dart pub get | |
echo "IS_VERSION_GREATER=$(dart run compare_versions.dart $THIS_VERSION $BASE_VERSION_${{ matrix.package }})" >> $GITHUB_ENV | |
popd || exit | |
- name: Publish (dry run) | |
id: publish_dry_run | |
if: ${{ env.IS_VERSION_GREATER == 1 }} | |
run: bash tool/publish.sh ${{ matrix.package }} --dry-run | |
- name: Skip publish (dry run) | |
id: skip_publish_dry_run | |
if: ${{ env.IS_VERSION_GREATER == 0 }} | |
run: echo "Skipping publish (dry run) for ${{ matrix.package }} because the version is not greater than the one on pub.dev" |