From 6eb22fdddba51aeda5e784f04618837989dcbcd0 Mon Sep 17 00:00:00 2001 From: Yauhen Landarski Date: Sun, 3 Mar 2024 23:06:25 +0100 Subject: [PATCH] Workaround to publish --- .github/workflows/publishing.yml | 2 +- .github/workflows/publishing_to_pub.yml | 44 +++++++++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publishing_to_pub.yml diff --git a/.github/workflows/publishing.yml b/.github/workflows/publishing.yml index 4bd7a0c..61d9604 100644 --- a/.github/workflows/publishing.yml +++ b/.github/workflows/publishing.yml @@ -10,4 +10,4 @@ jobs: publish: permissions: id-token: write - uses: dart-lang/setup-dart/.github/workflows/publish.yml@v1 + uses: touchlane/gridpad_flutter/.github/workflows/publishing_to_pub.yml@v1 diff --git a/.github/workflows/publishing_to_pub.yml b/.github/workflows/publishing_to_pub.yml new file mode 100644 index 0000000..2bd39d0 --- /dev/null +++ b/.github/workflows/publishing_to_pub.yml @@ -0,0 +1,44 @@ +name: Publish to pub.dev + +## Temporary workaround for the issue: https://github.com/dart-lang/setup-dart/issues/68 +## Originally copied from: https://github.com/dart-lang/setup-dart/blob/main/.github/workflows/publish.yml + +on: + workflow_call: + inputs: + environment: + description: if specified, the workflow is required to be run in this environment (with additional approvals) + required: false + type: string + working-directory: + description: directory with-in the repository where the package is located (if not in the repository root) + required: false + type: string + +jobs: + publish: + name: 'Publish to pub.dev' + environment: ${{ inputs.environment }} + permissions: + id-token: write # This is required for requesting the JWT + runs-on: ubuntu-latest + steps: + # Checkout repository + - uses: actions/checkout@v4 + # Setup Flutter SDK + - name: Setup Flutter SDK + uses: flutter-actions/setup-flutter@v2 + with: + channel: stable + version: 3.19.2 + # Minimal package setup and dry run checks. + - name: Install dependencies + run: flutter pub get + working-directory: ${{ inputs.working-directory }} + - name: Publish - dry run + run: dart pub publish --dry-run + working-directory: ${{ inputs.working-directory }} + # Publishing... + - name: Publish to pub.dev + run: dart pub publish -f + working-directory: ${{ inputs.working-directory }} \ No newline at end of file