Skip to content

Commit

Permalink
feat: add ci release web
Browse files Browse the repository at this point in the history
  • Loading branch information
lmquang committed Feb 21, 2024
1 parent 5426f9b commit b24db51
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/release-web.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release web

on:
push:
branches:
- cicd
- main
- mochi-web-prod

permissions:
contents: read # for checkout

jobs:
release-web:
permissions:
contents: write # to be able to publish a GitHub release
issues: write # to be able to comment on released issues
pull-requests: write # to be able to comment on released pull requests
id-token: write # to enable use of OIDC for npm provenance
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3 # v3
with:
fetch-depth: 0 # to be able to checkout any commit
persist-credentials: false # <--- this
- uses: pnpm/action-setup@v2
with:
version: 6.32.9
- uses: actions/setup-node@v3 # v3
with:
cache: pnpm
node-version: 18
- name: Install dependencies
run: pnpm install
# pinned version updated automatically by Renovate.
# details at https://semantic-release.gitbook.io/semantic-release/usage/installation#global-installation
- run: pnpm dlx [email protected]
env:
GITHUB_TOKEN: ${{ secrets.GH_PAT }}
29 changes: 29 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"branches": [
"mochi-web-prod",
{
"name": "main",
"prerelease": "rc"
}
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
[
"@semantic-release/npm",
{
"npmPublish": false,
"pkgRoot": "apps/mochi-web"
}
],
[
"@semantic-release/github",
{
"successComment": false
}
],
["@semantic-release/git", {
"assets": ["apps/mochi-web/package.json"]
}]
]
}
17 changes: 17 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
RELEASE_BRANCH=mochi-web-prod
BETA_BRANCH=main
DEVELOP_BRANCH=main

.PHONY: release
release: sync-release
git checkout $(BETA_BRANCH) && git pull origin $(BETA_BRANCH) && \
git checkout $(RELEASE_BRANCH) && git pull origin $(RELEASE_BRANCH) && \
git merge $(BETA_BRANCH) --no-edit --no-ff && \
git push origin $(RELEASE_BRANCH) && \
git checkout $(DEVELOP_BRANCH) && git push origin $(DEVELOP_BRANCH)

.PHONY: sync-release
sync-release:
git checkout $(RELEASE_BRANCH) && git pull origin $(RELEASE_BRANCH) && \
git checkout $(BETA_BRANCH) && git pull origin $(BETA_BRANCH) && \
git merge $(RELEASE_BRANCH) --no-edit --no-ff

0 comments on commit b24db51

Please sign in to comment.