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

feat: PRSDM-7228 gh-actions auto release main #17

Open
wants to merge 5 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
21 changes: 21 additions & 0 deletions .github/workflows/lint-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Lint PR Title"

on:
pull_request:
types:
- opened
- reopened
- edited
- synchronize
permissions:
pull-requests: read
contents: read
packages: read
jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 18 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: release
on:
push:
branches:
- main
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
persist-credentials: false # to disable default GITHUB_TOKEN

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15 changes: 11 additions & 4 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"branches": ["main", { "name": "develop", "prerelease": "rfv" }, "+([0-9])?(.{+([0-9]),x}).x"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Just note this will built for dec as well but set as a pre-release. We might just need to check how the content builder works with those tags.

Otherwise we can remove develop for now and just have the build for main?

"plugins": [
["@semantic-release/commit-analyzer",
[
"@semantic-release/commit-analyzer",
{
"releaseRules": [
{
Expand All @@ -10,8 +11,9 @@
}
]
}
],
["@semantic-release/release-notes-generator",
],
[
"@semantic-release/release-notes-generator",
{
"presetConfig": {
"types": [
Expand All @@ -24,6 +26,11 @@
}
}
],
["@semantic-release/github"]
[
"@semantic-release/github",
{
"successComment": false
}
]
]
}
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 2025-01-21
### Feature
- Add Snippet output for standalone articles in isolated contexts. @DustinFischer https://spandigital.atlassian.net/browse/PRSDM-7122
- Add Snippet output for standalone articles in isolated contexts. @DustinFischer https://spandigital.atlassian.net/browse/PRSDM-7122

## 2025-01-23
### Feature
- github action to auto generate semantic release for main.
- added pr title linting from https://github.com/SPANDigital/presidium-theme-website/commit/e940f801c5d29bcc479c3f6cc17b5b95ac2ef30d
- updated readme
@Quantumplate [PRSDM-7228](https://spandigital.atlassian.net/browse/PRSDM-7228)
68 changes: 67 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
# presidium-layouts-base
Base Hugo layouts for Presidium
This repo makes up the `layouts` portion of the Presidium System Level Theme, and contains the officially support theme features.
For more info on Hugo Themes see the official Hugo documentation [here](https://gohugo.io/hugo-modules/theme-components/)

# Getting Started

### Method 1 - Just using the Presidium Themes in your Hugo site (Default)
Update the `config.yml`:
```
module:
imports:
- path: github.com/spandigital/presidium-styling-base
- path: github.com/spandigital/presidium-layouts-base
```

### Method 2 - Working on contributing to this repo in local development.
1. Clone the theme
1. Clone the [presidium-test-validation](https://github.com/SPANDigital/presidium-test-validation) repo. We use the `presidium-test-validation` repo as the styling and functionality test bed, where we throw all the officially supported features in with the kitchen sink, so that we can validate every theme change has no unintended effects.
1. Open the `go.mod` file in your `presidium-test-validation` clone.
1. Add the following to the bottom of your `go.mod` file, and update the path after the arrow to the correct path where you cloned the theme layout:
```
replace github.com/spandigital/presidium-layouts-base => /{path-on-your-machine}/presidium-layouts-base
```

4. Run a refresh and then build the docset with Hugo:
```
make refresh
```
If you don't have the Makefile in your docset, then you can copy it from [here](https://github.com/SPANDigital/presidium/blob/develop/templates/default/Makefile)
Then run
```
make serve
```
Your served site should be available on `localhost:1313`.

---

## Conventional Commits

At SPAN we use [Conventional Commits 1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) to make our commit messages more useful.

## Semantic Releases

This repository uses [Semantic Release](https://semantic-release.gitbook.io/semantic-release/) tool to automate version management and package publishing.

Upon merging into to the main or develop branch, Semantic Release tool will:
- Calculate the new release version based on the commits
- Create a git commit and a git tag for the release
- Create a Release with release notes from the commit messages
- Create and publish the container images

---

## Branching

Please see this [Presidium Git Strategy Miro board](https://miro.com/app/board/uXjVPK0XxiU=/).

In summary:
- `main` ⇾ production
- Only hotfixes or `develop` get merged into `main`
- `develop`
- Feature branches and bug fixes are branched from and merged into `develop`
- `feat/<TITLE>`
- If there is a feature in development it will be on a feature branch

---

# Advanced Configuration

## Custom Output Formats

Expand Down
Loading