-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: Add CD workflow to generate semantic version
- Loading branch information
1 parent
2a5c707
commit 58872ed
Showing
1 changed file
with
63 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,63 @@ | ||
name: Continuous Delivery | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- add-semver-workflow | ||
|
||
jobs: | ||
release: | ||
if: contains(github.event.commits[0].message, 'chore(release)') == false | ||
name: Release | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 10 | ||
env: | ||
DRY_RUN: true | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
persist-credentials: false | ||
|
||
- name: Release | ||
id: release | ||
uses: ridedott/release-me-action@v3 | ||
with: | ||
dry-run: ${{ env.DRY_RUN }} | ||
release-branches: '["main", "add-semver-workflow"]' | ||
commit-assets: | | ||
./dist | ||
release-rules-append: | | ||
[ | ||
{ "release": "patch", "type": "build" }, | ||
{ "release": "patch", "type": "chore" }, | ||
{ "release": false, "type": "chore", "scope": "deps-dev" }, | ||
{ "release": "patch", "type": "chore", "scope": "deps-dev", "subject": "bump @zeit/ncc from*" }, | ||
{ "release": "patch", "type": "ci" }, | ||
{ "release": "patch", "type": "improvement" }, | ||
{ "release": "patch", "type": "refactor" }, | ||
{ "release": false, "subject": "*\\[skip release\\]*" } | ||
] | ||
- name: Authenticate | ||
if: steps.release.outputs.released == 'true' | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: true | ||
token: ${{ secrets.DOTTBOTT_TOKEN }} | ||
|
||
- uses: actions/checkout@v3 | ||
if: steps.release.outputs.released == 'true' | ||
with: | ||
fetch-depth: 1 | ||
persist-credentials: true | ||
|
||
- name: Tag | ||
if: steps.release.outputs.released == 'true' && env.DRY_RUN == 'false' | ||
run: | | ||
git push origin :refs/tags/'v${{ steps.release.outputs.major }}' | ||
git tag 'v${{ steps.release.outputs.major }}' --force | ||
git push --tags |