diff --git a/.github/workflows/auto-tag.yml b/.github/workflows/auto-tag.yml new file mode 100644 index 0000000..0782645 --- /dev/null +++ b/.github/workflows/auto-tag.yml @@ -0,0 +1,27 @@ +name: Auto Tag + +on: + workflow_run: + workflows: [Code Check] + types: + - completed + branches: + - main + +jobs: + auto-tag: + if: ${{ github.event.workflow_run.conclusion == 'success' }} + + runs-on: ubuntu-latest + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: "Auto Tag when the pubspec.yaml version changes" + uses: jacopocarlini/action-autotag@3.0.0 + with: + GITHUB_TOKEN: ${{ secrets.TAG_TOKEN }} + tag_prefix: "v" diff --git a/.github/workflows/code-check.yml b/.github/workflows/code-check.yml index 601e995..1050cad 100644 --- a/.github/workflows/code-check.yml +++ b/.github/workflows/code-check.yml @@ -20,6 +20,7 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true - name: Run Flutter Test run: flutter test @@ -33,6 +34,7 @@ jobs: - uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true - name: Run Flutter Format run: dart format --set-exit-if-changed . diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 122d889..ff92357 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,30 +1,33 @@ -name: release +name: Publish to pub.dev + on: - workflow_run: - workflows: [Code Check] - types: - - completed - branches: - - main + push: + tags: + - "v[0-9]+.[0-9]+.[0-9]" jobs: - release: - if: ${{ github.event.workflow_run.conclusion == 'success' }} + publish: runs-on: ubuntu-latest + permissions: + id-token: write steps: - name: Checkout uses: actions/checkout@v3 + - name: Install Dart + uses: dart-lang/setup-dart@v1 + with: + sdk: stable + - name: "Install Flutter" uses: subosito/flutter-action@v2 with: channel: "stable" + cache: true - name: Get all Flutter Packages run: flutter pub get - - name: Publish - uses: sakebook/actions-flutter-pub-publisher@v1.4.1 - with: - credential: ${{ secrets.CREDENTIAL_JSON }} + - name: Publish to pub.dev + run: flutter pub publish