From b0140af5c826ff8788a6db40c902fd4ca3fea10e Mon Sep 17 00:00:00 2001 From: Evgeny Biriulin Date: Wed, 31 Jan 2024 01:17:57 +0400 Subject: [PATCH] chore: add autorelease workflow --- .github/workflows/release.yml | 44 +++++++++++++++++++++++++++++++++++ version.json | 3 +++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 version.json diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..5210843 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,44 @@ +name: Release +on: + workflow_dispatch: + push: + branches: + - master + +jobs: + build: + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: '0' + + - name: Conventional Changelog Action + id: changelog + uses: TriPSs/conventional-changelog-action@v5 + with: + github-token: ${{ secrets.github_token }} + output-file: 'CHANGELOG.md' + preset: 'conventionalcommits' + version-file: './version.json' + skip-git-pull: 'true' + skip-on-empty: 'false' + + - name: 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: Update SemVer tag + uses: zyactions/update-semver@v1 + if: ${{ steps.changelog.outputs.skipped == 'false' }} + with: + tag: ${{ steps.changelog.outputs.tag }} \ No newline at end of file diff --git a/version.json b/version.json new file mode 100644 index 0000000..688e939 --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "version": "1.0.0" +} \ No newline at end of file