Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/add release automation #13

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Comment on lines +26 to +27
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This configuration would require a branch change to:

  • develop on develop
  • release on main

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"
]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ authors = [
description = "Work with WhatsApp Business Cloud API from your Frappe site"
requires-python = ">=3.10"
readme = "README.md"
dynamic = ["version"]
version = "0.0.1"
dependencies = []

[build-system]
Expand Down
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[metadata]
# compatibility until https://github.com/frappe/bench/pull/1502 is more adopted
version = 0.0.1
4 changes: 2 additions & 2 deletions waba_integration/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import importlib.metadata

__version__ = '0.0.1'

__version__ = importlib.metadata.version(__name__)
Loading