From 1cbd26e365f013e50e971f38d92e13079ccc5517 Mon Sep 17 00:00:00 2001 From: Mohammad Reza Moradi Date: Tue, 18 Jun 2024 11:36:07 +0200 Subject: [PATCH] chore: add github workflow to publish and issue triage --- .github/workflows/app.yaml | 23 +++++++++++++++ .github/workflows/issue-triage.yaml | 18 ++++++++++++ .github/workflows/main.yaml | 36 +++++++++++++++++++++++ .github/workflows/publish.yaml | 44 +++++++++++++++++++++++++++++ 4 files changed, 121 insertions(+) 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 diff --git a/.github/workflows/app.yaml b/.github/workflows/app.yaml new file mode 100644 index 0000000..f6344c3 --- /dev/null +++ b/.github/workflows/app.yaml @@ -0,0 +1,23 @@ +name: "All the sdk specific jobs" + +on: + workflow_call: + +jobs: + pub-dev-dry-run: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + channel: stable + cache: true + - name: Prepare publish + run: ./package_flutter.sh + - name: Check podfile + run: cat publishing/flutter/ios/flutter_olm.podspec + - name: pub.dev publish dry run + working-directory: publishing/flutter + run: | + flutter pub get + 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..45f742a --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,36 @@ +name: CI + +on: + push: + branches: + - main + tags: + - v[0-9]+.[0-9]+.[0-9]+ + 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" + secrets: + ssh_key: "${{ secrets.CI_SSH_PRIVATE_KEY }}" + + general: + permissions: + contents: read + uses: famedly/frontend-ci-templates/.github/workflows/general.yml@main + + app_jobs: + secrets: inherit + uses: ./.github/workflows/app.yml + + diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..c0741f0 --- /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@v3 + # Setup Dart SDK with JWT token + - uses: subosito/flutter-action@48cafc24713cca54bbe03cdc3a423187d413aafa + with: + flutter-version: '3.16.0' + 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@v3 + - name: Create release + run: | + gh release create ${{ github.ref_name }}