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 11258b7 commit 2140f55
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 0 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/make-release-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# forked (:p) from frappe/frappe

name: Create fortnightly release
on:
schedule:
# 13:00 UTC -> 7pm IST on every alternate Tuesday
- cron: '0 13 * * 2/2'
workflow_dispatch:

jobs:
release:
name: Release
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: octokit/[email protected]
with:
route: POST /repos/{owner}/{repo}/pulls
owner: frappe
repo: waba_integration
title: |-
"chore: merge 'develop' into 'main'"
body: "Automated fortnightly release"
base: main
head: develop
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_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 2140f55

Please sign in to comment.