-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: setup semantic release and pr tests
- Loading branch information
Showing
3 changed files
with
114 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Check Pull Request | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
release: | ||
name: release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
with: | ||
branch: main | ||
extra_plugins: | | ||
@semantic-release/git | ||
@semantic-release/changelog | ||
dry_run: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#--------------------------------------------------------- | ||
# - Create a semantical release | ||
# - Set latest tag | ||
#--------------------------------------------------------- | ||
name: Create a new release | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- main | ||
|
||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
# required antecedent | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
|
||
- name: Semantic Release | ||
uses: cycjimmy/semantic-release-action@v4 | ||
id: semantic | ||
with: | ||
branches: | | ||
[ | ||
'+([0-9])?(.{+([0-9]),x}).x', | ||
'main', | ||
'next', | ||
'next-major', | ||
{ | ||
name: 'beta', | ||
prerelease: true | ||
}, | ||
{ | ||
name: 'alpha', | ||
prerelease: true | ||
} | ||
] | ||
extra_plugins: | | ||
@semantic-release/git | ||
@semantic-release/changelog | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} | ||
GIT_COMMITTER_NAME: github-actions[bot] | ||
GIT_COMMITTER_EMAIL: github-actions[bot]@users.noreply.github.com | ||
GIT_AUTHOR_NAME: github-actions[bot] | ||
GIT_AUTHOR_EMAIL: github-actions[bot]@users.noreply.github.com | ||
|
||
- name: Publish To GitHub Package Registry | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: echo "new release was published" | ||
shell: bash | ||
|
||
- name: Push updates to branch for major version | ||
if: steps.semantic.outputs.new_release_published == 'true' | ||
run: "git push https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git HEAD:refs/heads/v${{steps.semantic.outputs.new_release_major_version}}" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = { | ||
"dryRun": false, | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
[ | ||
"@semantic-release/changelog", | ||
{ | ||
"changelogFile": "CHANGELOG.md" | ||
} | ||
], | ||
"@semantic-release/github", | ||
[ | ||
"@semantic-release/git", | ||
{ | ||
"assets": [ | ||
"CHANGELOG.md", | ||
"client/package.json", | ||
"client/package-lock.json", | ||
"requirements.txt", | ||
"api/terraform/python/layer_genai/requirements.txt", | ||
], | ||
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}" | ||
} | ||
] | ||
] | ||
}; |