From 1bcccf0101bcd2d95da63c571195873bfe8b6506 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Moradi Date: Thu, 20 Jun 2024 15:34:11 +0200 Subject: [PATCH] chore: add github workflow to publish and issue triage --- .github/workflows/app.yaml | 22 +++++++++++++++ .github/workflows/issue-triage.yaml | 18 ++++++++++++ .github/workflows/main.yaml | 31 ++++++++++++++++++++ .github/workflows/publish.yaml | 44 +++++++++++++++++++++++++++++ .github/workflows/versions.env | 2 ++ .gitlab-ci.yml | 13 --------- pubspec.yaml | 2 +- 7 files changed, 118 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/app.yaml create mode 100644 .github/workflows/issue-triage.yaml create mode 100644 .github/workflows/main.yaml create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/versions.env delete mode 100644 .gitlab-ci.yml diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml new file mode 100644 index 0000000..a5d59bf --- /dev/null +++ b/.github/workflows/app.yaml @@ -0,0 +1,22 @@ +name: "All the sdk specific jobs" + +on: + workflow_call: + +jobs: + pub-dev-dry-run: + runs-on: ubuntu-latest + steps: + # Checkout repository + - uses: actions/checkout@v4 + # Setup Dart SDK with JWT token + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + flutter-version: ${{ env.flutter_version }} + channel: stable + cache: true + # Minimal package setup and dry run checks. + - name: Install dependencies + run: flutter pub get + - name: Dry run + run: flutter pub publish --dry-run diff --git a/.github/workflows/issue-triage.yaml b/.github/workflows/issue-triage.yaml new file mode 100644 index 0000000..92a7abd --- /dev/null +++ b/.github/workflows/issue-triage.yaml @@ -0,0 +1,18 @@ +name: Add issues to Product Management Project. + +on: + issues: + types: + - opened + +jobs: + add-to-project: + name: Add issue to project + runs-on: ubuntu-latest + steps: + - uses: actions/add-to-project@v0.5.0 + with: + # You can target a repository in a different organization + # to the issue + project-url: https://github.com/orgs/famedly/projects/4 + github-token: ${{ secrets.ADD_ISSUE_TO_PROJECT_PAT }} diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..b3c2d8c --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,31 @@ +name: CI + +on: + push: + branches: + - main + pull_request: + merge_group: + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true + +jobs: + dart: + permissions: + contents: read + uses: famedly/frontend-ci-templates/.github/workflows/dart.yml@main + with: + env_file: ".github/workflows/versions.env" + + general: + permissions: + contents: read + uses: famedly/frontend-ci-templates/.github/workflows/general.yml@main + + app_jobs: + secrets: inherit + uses: ./.github/workflows/app.yaml + + diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..d79c444 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,44 @@ +name: Publish to pub.dev + +on: + push: + tags: + - v[0-9]+.[0-9]+.[0-9]+ + +# Publish using the reusable workflow from dart-lang +jobs: + publish: + name: Publish to pub.dev + environment: pub.dev + permissions: + contents: read + id-token: write # This is required for requesting the JWT + runs-on: ubuntu-latest + steps: + # Checkout repository + - uses: actions/checkout@v4 + # Setup Dart SDK with JWT token + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + flutter-version: ${{ env.flutter_version }} + channel: stable + cache: true + # Minimal package setup and dry run checks + - name: Install dependencies + run: flutter pub get + - uses: dart-lang/setup-dart@a57a6c04cf7d4840e88432aad6281d1e125f0d46 + - name: Dry run + run: dart pub publish --dry-run + # Publishing... + - name: Publish to pub.dev + run: dart pub publish -f + + create_release: + runs-on: ubuntu-latest + env: + GH_TOKEN: ${{ github.token }} + steps: + - uses: actions/checkout@v4 + - name: Create release + run: | + gh release create ${{ github.ref_name }} diff --git a/.github/workflows/versions.env b/.github/workflows/versions.env new file mode 100644 index 0000000..8431124 --- /dev/null +++ b/.github/workflows/versions.env @@ -0,0 +1,2 @@ +flutter_version=3.16.9 +dart_version=3.2.6 \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 615c3ca..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,13 +0,0 @@ -image: registry.gitlab.com/famedly/company/frontend/flutter-dockerimages/flutter/stable - -stages: - - test - -code_analyze: - tags: - - docker - stage: test - script: - - flutter pub get - - flutter format --set-exit-if-changed lib/ test/ - - flutter analyze diff --git a/pubspec.yaml b/pubspec.yaml index a0cbbcb..9d1ec4c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -2,7 +2,7 @@ name: fcm_shared_isolate description: Firebase Messaging Plugin for Flutter supporting shared isolate homepage: https://famedly.com version: 0.1.0 -repository: https://gitlab.com/famedly/libraries/fcm_shared_isolate +repository: https://github.com/famedly/fcm_shared_isolate issue_tracker: https://gitlab.com/famedly/libraries/fcm_shared_isolate/issues environment: