Skip to content

Commit

Permalink
feat: Add release action based on Conventional commits
Browse files Browse the repository at this point in the history
  • Loading branch information
fussel178 authored and Ludwig Richter committed Apr 28, 2021
1 parent 0be26d2 commit a500839
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 5 deletions.
1 change: 0 additions & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: Publish
name: Publish packages

# Events that trigger this workflow
on:
release:
types: [published]
workflow_run:
workflows: ["Release"]
types: [completed]

jobs:
publish:
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

# Events that trigger this workflow
on: [workflow_dispatch]

jobs:
conventional-release:
name: Conventional Commit Release
runs-on: ubuntu-latest
steps:
- name: Checkout 📥
uses: actions/checkout@v2.3.4

- name: Cache release upload URL ♻️
uses: actions/cache@v2.1.5
with:
path: ~/.build-env
key: 'github-release-action'

- name: Conventional Changelog Action 🎉
id: changelog
uses: TriPSs/conventional-changelog-action@v3.7.1
with:
github-token: ${{ secrets.github_token }}
git-user-name: ${{ github.actor }}
git-user-email: '${{ github.actor }}@users.noreply.github.com'
release-count: '0'
version-file: './project.json'

- name: Create Release 🪡
id: create_release
uses: actions/create-release@v1
if: ${{ steps.changelog.outputs.skipped == 'false' }}
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
with:
tag_name: ${{ steps.changelog.outputs.tag }}
release_name: ${{ steps.changelog.outputs.tag }}
body: ${{ steps.changelog.outputs.clean_changelog }}

- name: Store upload url 🗜
run: |
echo "upload_url=${UPLOAD_URL}" >> ~/.build-env
echo "tag=${RELEASE_TAG}" >> ~/.build-env
echo "skipped=${RELEASE_SKIPPED}" >> ~/.build-env
env:
UPLOAD_URL: ${{ steps.create_release.outputs.upload_url }}
RELEASE_TAG: ${{ steps.changelog.outputs.tag }}
RELEASE_SKIPPED: ${{ steps.changelog.outputs.skipped }}
2 changes: 1 addition & 1 deletion .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: reviewdog

# Events that trigger this workflow
on: workflow_dispatch
on: [workflow_dispatch]

jobs:
check_style:
Expand Down
3 changes: 3 additions & 0 deletions project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"version": "0.0.19"
}

0 comments on commit a500839

Please sign in to comment.