Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,21 @@ on:
push:
branches:
- main
pull_request:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
pull-requests: write
contents: write

jobs:
release-stable:
runs-on: ubuntu-latest
name: Release Stable
outputs:
published: ${{ steps.changesets.outputs.published }}
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down Expand Up @@ -43,7 +49,7 @@ jobs:
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./package.json').version")" >> $GITHUB_ENV

- name: Create Github Release
if: steps.changesets.outputs.published == 'true'
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}
Expand All @@ -52,7 +58,8 @@ jobs:
runs-on: ubuntu-latest
name: Release Unstable
needs: release-stable
if: always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
if: "always() && (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == 'ayanworks/credo-ethr-module') || (github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version'))"

steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down