diff --git a/.github/workflows/make-release-pr.yml b/.github/workflows/make-release-pr.yml new file mode 100644 index 00000000..a9597c9a --- /dev/null +++ b/.github/workflows/make-release-pr.yml @@ -0,0 +1,33 @@ +# This workflow is agnostic to branches. Only maintain on develop branch. +# To add/remove versions just modify the matrix. + +name: Create weekly release pull requests +on: + schedule: + # 13:00 UTC -> 7pm IST on every alternate Tuesday + - cron: '0 13 * * 2/2' + workflow_dispatch: + +jobs: + stable-release: + name: Release + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + version: ["14", "15"] + + steps: + - uses: octokit/request-action@v2.x + with: + route: POST /repos/{owner}/{repo}/pulls + owner: frappe + repo: payments + title: |- + "chore: release v${{ matrix.version }}" + body: "Automated weekly release." + base: version-${{ matrix.version }} + head: develop + env: + GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }} + diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..de7fcdec --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,28 @@ +name: Generate Semantic Release +on: + push: + branches: + - main + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout Entire Repository + uses: actions/checkout@v3 + with: + fetch-depth: 0 + persist-credentials: false + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: 18 + - name: Setup dependencies + run: | + npm install @semantic-release/git @semantic-release/exec --no-save + pip install toml-cli + - name: Create Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release diff --git a/.releaserc b/.releaserc new file mode 100644 index 00000000..c0da374d --- /dev/null +++ b/.releaserc @@ -0,0 +1,31 @@ +{ + "branches": [ + "main" + ], + "plugins": [ + "@semantic-release/commit-analyzer", + { + "preset": "angular", + "releaseRules": [ + { + "breaking": true, + "release": false + } + ] + }, + [ + "@semantic-release/exec", + { + "prepareCmd": 'toml set --toml-path pyproject.toml project.version ${nextRelease.version}' + } + ], + [ + "@semantic-release/git", + { + "assets": ["pyproject.toml"], + "message": "chore(release): bumped to v${nextRelease.version}" + } + ], + "@semantic-release/github" + ] +}