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

chore: release #2

Merged
merged 5 commits into from
May 30, 2024
Merged
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
Binary file added .github/development-flow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions .github/workflows/approve-merge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Merge Release PR

on:
pull_request_review:
types: [submitted]

jobs:
pr_approved:
if: ${{ github.event.review.state == 'approved' && github.event.pull_request.base.ref == 'master' && github.event.pull_request.head.ref == 'next' }}
runs-on: ubuntu-latest
steps:
- name: Clone git repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Merge PR
run: |
git checkout master
git merge --ff origin/next
git push -u origin master
- uses: benc-uk/workflow-dispatch@v1
with:
workflow: release.yaml
ref: master
2 changes: 1 addition & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: build
name: Build

on: push

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
pull-requests: read

jobs:
main:
lint:
name: pr-lint
runs-on: ubuntu-latest
steps:
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Release PR

on:
push:
branches:
- next

permissions:
contents: read

jobs:
release_pr:
permissions:
issues: write
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Install Dependencies
run: npm clean-install

- name: Generate Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
echo '# Release Changes' > changes.md
npx [email protected] -d -p '@semantic-release/release-notes-generator' -b next | grep -v semantic-release | tee -a changes.md
printf '\n---\n\n### Approve this PR to release above packages!' >> changes.md
- name: Create PR
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ex
export PR_NUMBER=$(gh pr list -B master -H next --json number | jq -r '.[0].number')
if [[ "$(git rev-parse origin/master)" == "$(git rev-parse origin/next)" ]]; then exit 0; fi
if [[ "$PR_NUMBER" == "null" ]]; then gh pr create -B master -H next -t "chore: release" -F changes.md; fi
if [[ "$PR_NUMBER" != "null" ]]; then gh pr edit $PR_NUMBER -F changes.md; fi
10 changes: 10 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
workflow_dispatch:

permissions:
contents: read
Expand All @@ -17,6 +18,8 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
ref: master

- uses: docker/login-action@v3
with:
Expand Down Expand Up @@ -61,3 +64,10 @@ jobs:
- run: npx [email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: benc-uk/workflow-dispatch@v1
with:
workflow: upgrade-services.yaml
ref: master
repo: restorecommerce/charts
token: "${{ secrets.CHARTS_WORKFLOW_TOKEN }}"
23 changes: 23 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Contributing Guidelines

## Commit Messages

This repository uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) and [commitlint](https://commitlint.js.org)
to standardize the commit messages.

## Development Flow

This repository follows a gitflow-style development.

The `main`/`master` branch is locked, and only allows pull requests.
Any change in the `main`/`master` branch gets automatically released via [semantic-release](https://github.com/semantic-release/semantic-release).

The `next` branch gets merged into `main`/`master` on an unscheduled basis.

Any change to the repository requires a new branch from the `next` branch, which then gets merged back into it with a pull request.

The pull request title must follow the same rules as commit messages and it gets linted.

The following diagram visualizes the development flow:

![development flow](./.github/development-flow.png)
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ COPY package-lock.json package-lock.json
COPY --chown=node:node . $APP_HOME
COPY --chown=node:node --from=build $APP_HOME/lib $APP_HOME/lib

EXPOSE 50051
EXPOSE 389

USER node

Expand Down
2 changes: 1 addition & 1 deletion cfg/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
},
"ldap": {
"host": "0.0.0.0",
"port": 1389,
"port": 389,
"tls": {
"certificate": "",
"key": ""
Expand Down
23 changes: 23 additions & 0 deletions cfg/config_production.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"logger": {
"elasticsearch": {
"level": "error",
"clientOpts": {
"node": "http://elasticsearch:9200"
},
"dataStream": true,
"source": "ldap-srv"
},
"console": {
"handleExceptions": false,
"level": "info",
"colorize": true,
"prettyPrint": true
}
},
"client": {
"user": {
"address": "identity-srv:50051"
}
}
}
3 changes: 2 additions & 1 deletion cfg/config_test.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
}
},
"ldap": {
"host": "127.0.0.1"
"host": "127.0.0.1",
"port": 1389
}
}
Loading