Skip to content

Commit

Permalink
fix: add release automation
Browse files Browse the repository at this point in the history
  • Loading branch information
blaggacao committed Dec 19, 2023
1 parent 51ab6fa commit 1e84084
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/make-release-pr.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 }}

28 changes: 28 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
31 changes: 31 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit 1e84084

Please sign in to comment.