Skip to content

Commit

Permalink
ci: fix release with merge commit (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: Timo Glastra <timo@animo.id>
  • Loading branch information
TimoGlastra authored Jan 30, 2025
1 parent 541c0da commit a9907d6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 2 additions & 5 deletions .changeset/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@ const getAddMessage = async (changeset) => {
return `docs(changeset): ${changeset.summary}\n\n${getSignedOffBy()}\n`
}

const getVersionMessage = async (releasePlan) => {
const publishableReleases = releasePlan.releases.filter((release) => release.type !== 'none')
const releasedVersion = publishableReleases[0].newVersion

return `chore(release): version ${releasedVersion}\n\n${getSignedOffBy()}\n`
const getVersionMessage = async () => {
return `chore(release): new version\n\n${getSignedOffBy()}\n`
}

module.exports = {
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ jobs:
release-stable:
runs-on: ubuntu-20.04
name: Release Stable
outputs:
published: ${{ steps.changesets.outputs.published }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand All @@ -25,7 +27,7 @@ jobs:
- name: Install Dependencies
run: pnpm install --frozen-lockfile

- name: Create Release Pull Request
- name: Create Release Pull Request or Publish to npm
id: changesets
uses: changesets/action@v1
with:
Expand All @@ -42,15 +44,16 @@ jobs:
run: echo "CURRENT_PACKAGE_VERSION=$(node -p "require('./packages/oid4vci/package.json').version")" >> $GITHUB_ENV

- name: Create Github Release
if: "startsWith(github.event.head_commit.message, 'chore(release): new version')"
if: steps.changesets.outputs.published == 'true'
uses: softprops/action-gh-release@v2
with:
tag_name: v${{ env.CURRENT_PACKAGE_VERSION }}

release-unstable:
runs-on: ubuntu-20.04
name: Release Unstable
if: "always() && github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release): new version')"
needs: release-stable
if: always() && github.event_name == 'push' && needs.release-stable.outputs.published == 'false'
steps:
- name: Checkout Repo
uses: actions/checkout@v4
Expand Down

0 comments on commit a9907d6

Please sign in to comment.