Skip to content

Commit

Permalink
ci: Add CD workflow to generate semantic version
Browse files Browse the repository at this point in the history
  • Loading branch information
fabidick22 committed Jul 7, 2022
1 parent 2a5c707 commit 58872ed
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/cd-semver.yml
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

0 comments on commit 58872ed

Please sign in to comment.