From d37336fb84d41bddcf842632cdb2219e5a2bad98 Mon Sep 17 00:00:00 2001 From: stdavis Date: Thu, 12 Dec 2024 13:54:15 -0700 Subject: [PATCH] chore: add github workflows and dependabot config --- .github/dependabot.yml | 21 +++++++++++ .github/workflows/pull_request.yml | 35 ++++++++++++++++++ .github/workflows/push.yml | 31 ++++++++++++++++ .github/workflows/release.yml | 57 ++++++++++++++++++++++++++++++ 4 files changed, 144 insertions(+) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/pull_request.yml create mode 100644 .github/workflows/push.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7a73159 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,21 @@ +version: 2 +updates: + - package-ecosystem: npm + directory: / + schedule: + interval: monthly + groups: + safe-dependencies: + update-types: ['minor', 'patch'] + major-dependencies: + update-types: ['major'] + commit-message: + prefix: deps + prefix-development: deps(dev) + - package-ecosystem: github-actions + directory: / + schedule: + interval: monthly + groups: + ci-dependencies: + dependency-type: 'production' diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml new file mode 100644 index 0000000..d20d470 --- /dev/null +++ b/.github/workflows/pull_request.yml @@ -0,0 +1,35 @@ +name: Pull Request Events + +on: pull_request + +permissions: + contents: write + id-token: write + pull-requests: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} + cancel-in-progress: true + +jobs: + test-check: + name: Lint + runs-on: ubuntu-latest + + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: โŽ” Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: lts/* + cache: pnpm + + - name: ๐Ÿ“ฅ Download dependencies + run: pnpm i + + - name: ๐Ÿงถ Lint + run: pnpm run lint diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 0000000..ac2c2b5 --- /dev/null +++ b/.github/workflows/push.yml @@ -0,0 +1,31 @@ +name: Push Events + +on: + push: + branches: + - dev + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + release-please: + name: Create release + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + + steps: + - name: ๐Ÿš€ Create Release + id: release-please + uses: agrc/release-composite-action@v1 + with: + prerelease: ${{ github.ref_name == 'dev' }} + repo-token: ${{ secrets.GITHUB_TOKEN }} + github-app-id: ${{ secrets.UGRC_RELEASE_BOT_APP_ID }} + github-app-key: ${{ secrets.UGRC_RELEASE_BOT_APP_KEY }} + github-app-name: ${{ secrets.UGRC_RELEASE_BOT_NAME }} + github-app-email: ${{ secrets.UGRC_RELEASE_BOT_EMAIL }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..701cb49 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release Events + +on: + release: + types: [published] + +permissions: + id-token: write + deployments: write + +jobs: + deploy: + name: Deploy + runs-on: ubuntu-latest + + steps: + - name: โฌ‡๏ธ Set up code + uses: actions/checkout@v4 + with: + show-progress: false + + - name: โŽ” Setup Node.js + uses: actions/setup-node@v4 + with: + cache: pnpm + node-version: lts/* + + - name: ๐Ÿ“ฅ Download dependencies + run: pnpm i + + - name: ๐Ÿšข Deploy to NPM as 'latest' + if: github.event.release.prerelease == false + run: pnpm publish + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + - name: ๐Ÿšข Deploy to NPM as 'beta' + if: github.event.release.prerelease == true + run: pnpm publish --tag beta + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + + notify: + name: Notifications + needs: deploy + if: github.event.release.prerelease == false + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: write + issues: write + + steps: + - name: Release Notifier + uses: agrc/release-issue-notifications-action@v1 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }}