From dd4d815fbdc6f185bace3a17a96ba0160abcbd0c Mon Sep 17 00:00:00 2001 From: David Rogers Date: Mon, 4 Nov 2024 23:05:14 -0800 Subject: [PATCH] feat: add release please action to automate releases (#2497) (#2498) --- .github/workflows/release-please.yml | 24 ++++++++++++++++++++++++ .github/workflows/run-checks.yml | 24 +++++++++++++++++------- .prettierignore | 1 + .release-please-manifest.json | 3 +++ release-please-config.json | 22 ++++++++++++++++++++++ 5 files changed, 67 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 release-please-config.json diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 00000000..b222da4c --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,24 @@ +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +name: release-please + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: release-please-config.json + # this assumes that you have created a personal access token + # (PAT) and configured it as a GitHub action secret named + # `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important). + token: ${{ secrets.HCA_RELEASE_PLEASE_TOKEN }} + # This is a built-in strategy in release-please, see "Action Inputs" for more options diff --git a/.github/workflows/run-checks.yml b/.github/workflows/run-checks.yml index c2a9d52e..b4e4a587 100644 --- a/.github/workflows/run-checks.yml +++ b/.github/workflows/run-checks.yml @@ -5,12 +5,22 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version: "20.10.0" - - run: | - npm ci - npm run check-format - npm run lint - npx tsc --noEmit + - name: Cache npm cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + - name: Install dependencies + run: npm ci + - name: Next.js Build + run: npm run build-prod:data-portal + - name: Run Prettier + run: npm run check-format + - name: Run Linter (ESLint) + run: npm run lint + - name: Type Check + run: npx tsc --noEmit diff --git a/.prettierignore b/.prettierignore index e477a49e..1f5ea3aa 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,5 +1,6 @@ # general README.md +CHANGELOG.md # testing coverage diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..895bf0e3 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "2.0.0" +} diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..99c48251 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,22 @@ +{ + "monorepo-tags": false, + "packages": { + ".": { + "release-type": "node", + "component": "", + "include-component-in-tag": false + } + }, + "changelog-sections": [ + { "type": "feat", "section": "Features" }, + { "type": "fix", "section": "Bug Fixes" }, + { "type": "chore", "section": "Chores" }, + { "type": "docs", "section": "Documentation" }, + { "type": "style", "section": "Styles" }, + { "type": "refactor", "section": "Code Refactoring" }, + { "type": "perf", "section": "Performance Improvements" }, + { "type": "test", "section": "Tests" }, + { "type": "build", "section": "Build System" }, + { "type": "ci", "section": "Continuous Integration" } + ] +}