diff --git a/.github/workflows/cd.yaml b/.github/workflows/cd.yaml new file mode 100644 index 0000000..f35665e --- /dev/null +++ b/.github/workflows/cd.yaml @@ -0,0 +1,29 @@ +name: Bump Semantic Version + +on: + push: + branches: + - main + +jobs: + check: + uses: ./.github/workflows/check.yaml + + deploy: + needs: check + runs-on: ubuntu-latest + timeout-minutes: 5 + + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Create pull request with incremented tag + id: run-tagpr + uses: Songmu/tagpr@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml new file mode 100644 index 0000000..add652e --- /dev/null +++ b/.github/workflows/check.yaml @@ -0,0 +1,28 @@ +name: Check Package + +on: + workflow_call: + +jobs: + ci: + runs-on: ubuntu-latest + timeout-minutes: 5 + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install pnpm + run: npm install -g pnpm + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: '.node-version' + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Run tests + run: pnpm test diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 31e63f7..6cf313d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -1,4 +1,4 @@ -name: CI on pull request +name: CI for before & after Pull Request Merge on: pull_request: @@ -7,24 +7,5 @@ on: - main jobs: - ci: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Install pnpm - run: npm install -g pnpm - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: '.node-version' - cache: 'pnpm' - - - name: Install dependencies - run: pnpm install - - - name: Run tests - run: pnpm test + call-common-checks: + uses: ./.github/workflows/check.yaml diff --git a/.tagpr b/.tagpr new file mode 100644 index 0000000..363b3c8 --- /dev/null +++ b/.tagpr @@ -0,0 +1,43 @@ +# config file for the tagpr in git config format +# The tagpr generates the initial configuration, which you can rewrite to suit your environment. +# CONFIGURATIONS: +# tagpr.releaseBranch +# Generally, it is "main." It is the branch for releases. The tagpr tracks this branch, +# creates or updates a pull request as a release candidate, or tags when they are merged. +# +# tagpr.versionFile +# Versioning file containing the semantic version needed to be updated at release. +# It will be synchronized with the "git tag". +# Often this is a meta-information file such as gemspec, setup.cfg, package.json, etc. +# Sometimes the source code file, such as version.go or Bar.pm, is used. +# If you do not want to use versioning files but only git tags, specify the "-" string here. +# You can specify multiple version files by comma separated strings. +# +# tagpr.vPrefix +# Flag whether or not v-prefix is added to semver when git tagging. (e.g. v1.2.3 if true) +# This is only a tagging convention, not how it is described in the version file. +# +# tagpr.changelog (Optional) +# Flag whether or not changelog is added or changed during the release. +# +# tagpr.command (Optional) +# Command to change files just before release. +# +# tagpr.template (Optional) +# Pull request template in go template format +# +# tagpr.release (Optional) +# GitHub Release creation behavior after tagging [true, draft, false] +# If this value is not set, the release is to be created. +# +# tagpr.majorLabels (Optional) +# Label of major update targets. Default is [major] +# +# tagpr.minorLabels (Optional) +# Label of minor update targets. Default is [minor] +# +[tagpr] + vPrefix = true + releaseBranch = main + release = false + versionFile = package.json