Skip to content

Commit

Permalink
chore: introduce dev branch and pipelines (#47)
Browse files Browse the repository at this point in the history
* feat: introduce dev branch and pipelines

* chore: replace git checkout with git switch

* chore: remove main to dev update pipeline

---------

Co-authored-by: Quake <QuakeEye@users.noreply.GitHub.com>
  • Loading branch information
QuakeEye and QuakeEye authored Apr 29, 2024
1 parent b8faaa5 commit fd85d52
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 11 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pr-dev-to-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Create Pull Request from dev to main

on:
workflow_dispatch:

jobs:
merge:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Fetch All
run: git fetch --all

- name: Get Latest Tag
id: previoustag
uses: WyriHaximus/github-action-get-previous-tag@v1.4.0
with:
fallback: v1.0.0

- name: Create Dev to Main Pull Request
run: |
git checkout dev
git pull
git switch -c dev-${{ steps.previoustag.outputs.tag }}
git push origin dev-${{ steps.previoustag.outputs.tag }}
gh pr create --base main --head dev-${{ steps.previoustag.outputs.tag }} --title "Merge dev at version ${{ steps.previoustag.outputs.tag }} to main" --body "This PR merges the dev branch at version ${{ steps.previoustag.outputs.tag }} to the main branch."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .github/workflows/test-build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- dev

jobs:
test-build:
Expand Down
23 changes: 12 additions & 11 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
module.exports = {
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
[
"@semantic-release/exec"
]
],
"branches": [
"main"
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/github",
[
"@semantic-release/exec"
]
}
],
"branches": [
{ name: "main" },
{ name: "dev", channel: "dev", prerelease: true }
]
}

0 comments on commit fd85d52

Please sign in to comment.