Skip to content

Commit

Permalink
Update publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
tilucasoli committed Jul 26, 2024
1 parent 9daf53a commit d0c5409
Showing 1 changed file with 65 additions and 64 deletions.
129 changes: 65 additions & 64 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,75 +29,76 @@ concurrency:
cancel-in-progress: true

jobs:
# publish-dry-run:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout mix repo
# uses: actions/checkout@v4
publish-dry-run:
runs-on: ubuntu-latest
steps:
- name: Checkout mix repo
uses: actions/checkout@v4

# - name: Install FVM
# shell: bash
# run: |
# curl -fsSL https://fvm.app/install.sh | bash
# fvm use ${{ inputs.flutter-version }} --force
- name: Install FVM
shell: bash
run: |
curl -fsSL https://fvm.app/install.sh | bash
fvm use ${{ inputs.flutter-version }} --force
# - uses: kuhnroyal/flutter-fvm-config-action@v2
# id: fvm-config-action
- uses: kuhnroyal/flutter-fvm-config-action@v2
id: fvm-config-action

# - uses: subosito/flutter-action@v2
# with:
# flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
# channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}
- uses: subosito/flutter-action@v2
with:
flutter-version: ${{ steps.fvm-config-action.outputs.FLUTTER_VERSION }}
channel: ${{ steps.fvm-config-action.outputs.FLUTTER_CHANNEL }}

# - name: Setup Melos
# uses: bluefireteam/melos-action@v3
- name: Setup Melos
uses: bluefireteam/melos-action@v3

# - name: Run melos fix
# run: |
# if [[ "${{ github.event.inputs.mix_lint }}" == "true" ]]; then
# cd packages/mix_lint && dart pub publish --dry-run && cd ../..
# fi
# if [[ "${{ github.event.inputs.mix_annotations }}" == "true" ]]; then
# cd packages/mix_annotations && dart pub publish --dry-run && cd ../..
# fi
# if [[ "${{ github.event.inputs.mix_generator }}" == "true" ]]; then
# cd packages/mix_generator && dart pub publish --dry-run && cd ../..
# fi
# if [[ "${{ github.event.inputs.mix }}" == "true" ]]; then
# cd packages/mix && dart pub publish --dry-run && cd ../..
# fi
# if [[ "${{ github.event.inputs.remix }}" == "true" ]]; then
# cd packages/remix && dart pub publish --dry-run && cd ../..
# fi
# shell: bash
- name: Run melos fix
run: |
if [[ "${{ github.event.inputs.mix_lint }}" == "true" ]]; then
cd packages/mix_lint && dart pub publish --dry-run && cd ../..
fi
if [[ "${{ github.event.inputs.mix_annotations }}" == "true" ]]; then
cd packages/mix_annotations && dart pub publish --dry-run && cd ../..
fi
if [[ "${{ github.event.inputs.mix_generator }}" == "true" ]]; then
cd packages/mix_generator && dart pub publish --dry-run && cd ../..
fi
if [[ "${{ github.event.inputs.mix }}" == "true" ]]; then
cd packages/mix && dart pub publish --dry-run && cd ../..
fi
if [[ "${{ github.event.inputs.remix }}" == "true" ]]; then
cd packages/remix && dart pub publish --dry-run && cd ../..
fi
shell: bash

# test-mincompat:
# needs: [publish-dry-run]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout mix repo
# uses: actions/checkout@v4
test-mincompat:
needs: [publish-dry-run]
runs-on: ubuntu-latest
steps:
- name: Checkout mix repo
uses: actions/checkout@v4

# - name: Run Tests
# uses: ./.github/actions/test/
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# flutter-version: 'mincompat'
- name: Run Tests
uses: ./.github/actions/test/
with:
token: ${{ secrets.GITHUB_TOKEN }}
flutter-version: 'mincompat'

# test-stable:
# needs: [publish-dry-run]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout mix repo
# uses: actions/checkout@v4
test-stable:
needs: [publish-dry-run]
runs-on: ubuntu-latest
steps:
- name: Checkout mix repo
uses: actions/checkout@v4

# - name: Run Tests
# uses: ./.github/actions/test/
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
- name: Run Tests
uses: ./.github/actions/test/
with:
token: ${{ secrets.GITHUB_TOKEN }}

prepare-matrix:
name: Selecting packages to publish
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
Expand All @@ -123,7 +124,7 @@ jobs:
echo "matrix=$(IFS=,; echo "[${matrix[*]}]")" >> $GITHUB_OUTPUT
publish:
needs: [prepare-matrix]
needs: [test-mincompat, test-stable, publish-dry-run, prepare-matrix]
environment: Production
runs-on: ubuntu-latest
strategy:
Expand All @@ -132,7 +133,7 @@ jobs:
package: ${{fromJSON(needs.prepare-matrix.outputs.matrix)}}
steps:
- uses: actions/checkout@v4
- name: Echo matrix
- name: Print packages
run: echo "${{ matrix.package.name }} and ${{ matrix.package.path }}"
shell: bash
# - name: '>> publish ${{ matrix.package.name }} package to pub.dev <<'
Expand All @@ -143,8 +144,8 @@ jobs:
# refreshToken: ${{ secrets.OAUTH_REFRESH_TOKEN }}
# relativePath: ${{ matrix.package.path }}
# - name: 'Commit release tag'
# if: steps.publish.outputs.success
# uses: hole19/git-tag-action@master
# env:
# TAG: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# if: steps.publish.outputs.success
# uses: hole19/git-tag-action@master
# env:
# TAG: ${{steps.publish.outputs.package}}-${{steps.publish.outputs.localVersion}}
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit d0c5409

Please sign in to comment.