From b03843c343d47ebed483b821a14fd3fba9e8cdd8 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Fri, 29 Apr 2022 16:24:41 +0200 Subject: [PATCH 1/4] Create publish.yml --- .github/workflows/publish.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..b48b76d3e --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,34 @@ +# This workflow publishes the dart and the flutter package to pub.dev, when a new release +# or pre-release is published on GitHub. +# +# Just before publishing, the code is formatted. + +name: publish-release +on: + release: + types: + - published # Triggering when either a release or a pre-release has been published + +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout the code + uses: actions/checkout@v3 + + - name: Publish the dart package + uses: k-paxian/dart-package-publisher@v1.3 + with: + accessToken: ${{ secrets.PUBLISH_OAUTH_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBLISH_OAUTH_REFRESH_TOKEN }} + relativePath: packages/dart + format: true + + - name: Publish the flutter package + uses: k-paxian/dart-package-publisher@v1.3 + with: + accessToken: ${{ secrets.PUBLISH_OAUTH_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBLISH_OAUTH_REFRESH_TOKEN }} + flutter: true + relativePath: packages/flutter + format: true From 6a901d03ec82cf8f755a46c17e67a7828c0ec1f1 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Fri, 29 Apr 2022 23:23:55 +0200 Subject: [PATCH 2/4] ci: set dryRunOnly to true --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b48b76d3e..8d89897bc 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,6 +23,7 @@ jobs: refreshToken: ${{ secrets.PUBLISH_OAUTH_REFRESH_TOKEN }} relativePath: packages/dart format: true + dryRunOnly: true # Just temporary for testing - name: Publish the flutter package uses: k-paxian/dart-package-publisher@v1.3 @@ -32,3 +33,4 @@ jobs: flutter: true relativePath: packages/flutter format: true + dryRunOnly: true # Just temporary for testing From e6cdc48f59c76d57c4801d35135ead0a5cabbbd9 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Sat, 30 Apr 2022 20:47:15 +0200 Subject: [PATCH 3/4] Rename release secrets and do some formatting --- .github/workflows/publish.yml | 36 ---------------------------- .github/workflows/release-manual.yml | 28 ++++++++++++++++++++++ 2 files changed, 28 insertions(+), 36 deletions(-) delete mode 100644 .github/workflows/publish.yml create mode 100644 .github/workflows/release-manual.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 8d89897bc..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,36 +0,0 @@ -# This workflow publishes the dart and the flutter package to pub.dev, when a new release -# or pre-release is published on GitHub. -# -# Just before publishing, the code is formatted. - -name: publish-release -on: - release: - types: - - published # Triggering when either a release or a pre-release has been published - -jobs: - release: - runs-on: ubuntu-latest - steps: - - name: Checkout the code - uses: actions/checkout@v3 - - - name: Publish the dart package - uses: k-paxian/dart-package-publisher@v1.3 - with: - accessToken: ${{ secrets.PUBLISH_OAUTH_ACCESS_TOKEN }} - refreshToken: ${{ secrets.PUBLISH_OAUTH_REFRESH_TOKEN }} - relativePath: packages/dart - format: true - dryRunOnly: true # Just temporary for testing - - - name: Publish the flutter package - uses: k-paxian/dart-package-publisher@v1.3 - with: - accessToken: ${{ secrets.PUBLISH_OAUTH_ACCESS_TOKEN }} - refreshToken: ${{ secrets.PUBLISH_OAUTH_REFRESH_TOKEN }} - flutter: true - relativePath: packages/flutter - format: true - dryRunOnly: true # Just temporary for testing diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml new file mode 100644 index 000000000..dab486186 --- /dev/null +++ b/.github/workflows/release-manual.yml @@ -0,0 +1,28 @@ +name: release-manual +on: + release: + types: + - published +jobs: + release: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Publish dart package + uses: k-paxian/dart-package-publisher@v1.3 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/dart + format: true + dryRunOnly: true + - name: Publish flutter package + uses: k-paxian/dart-package-publisher@v1.3 + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + flutter: true + relativePath: packages/flutter + format: true + dryRunOnly: true From b705836e5477a6ece0105d223209df9104948521 Mon Sep 17 00:00:00 2001 From: Maximilian Fischer Date: Sat, 30 Apr 2022 21:11:32 +0200 Subject: [PATCH 4/4] release-manual: add dry-run --- .github/workflows/release-manual.yml | 29 ++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-manual.yml b/.github/workflows/release-manual.yml index dab486186..e6d805df7 100644 --- a/.github/workflows/release-manual.yml +++ b/.github/workflows/release-manual.yml @@ -4,8 +4,35 @@ on: types: - published jobs: + dry-run: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v3 + - name: Dry run dart package + uses: k-paxian/dart-package-publisher@v1.3 + id: try-dart + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + relativePath: packages/dart + format: true + dryRunOnly: true + - name: Dry run flutter package + uses: k-paxian/dart-package-publisher@v1.3 + id: try-flutter + with: + accessToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_ACCESS_TOKEN }} + refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} + flutter: true + relativePath: packages/flutter + format: true + dryRunOnly: true + - name: Check outputs + run: ${{steps.try-dart.outputs.success}} && ${{steps.try-flutter.outputs.success}} release: runs-on: ubuntu-latest + needs: dry-run steps: - name: Checkout code uses: actions/checkout@v3 @@ -16,7 +43,6 @@ jobs: refreshToken: ${{ secrets.PUBDEV_GOOGLE_ACCOUNT_REFRESH_TOKEN }} relativePath: packages/dart format: true - dryRunOnly: true - name: Publish flutter package uses: k-paxian/dart-package-publisher@v1.3 with: @@ -25,4 +51,3 @@ jobs: flutter: true relativePath: packages/flutter format: true - dryRunOnly: true