Skip to content
Merged
Show file tree
Hide file tree
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
33 changes: 10 additions & 23 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,24 @@ name: Publish

on:
workflow_dispatch:
workflow_call:
inputs:
branch:
description: The branch containing the release code snapshot
required: true
type: string
default: ""
push:
branches:
- main
tags:
- 'v*.*.*'
release:
types:
- published

permissions:
contents: write
id-token: write

jobs:
publish-ea:
if: startsWith(github.ref, 'refs/tags/') == false
if: github.event_name == 'push'
runs-on: ubuntu-latest
name: Publish EA release to NPM
steps:
Expand Down Expand Up @@ -70,14 +72,14 @@ jobs:
npm publish --verbose --tag ea --access public --provenance

publish-release:
if: startsWith(github.ref, 'refs/tags/')
if: github.event_name == 'workflow_call' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
name: Publish release to NPM
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
ref: ${{ inputs.branch || github.ref }}
fetch-depth: 0

- name: Install node 24
Expand All @@ -90,21 +92,6 @@ jobs:
- name: Update npm
run: npm install -g npm@latest

- name: Get tag name
id: tag
run: |
TAG_NAME=${GITHUB_REF#refs/tags/}
echo "name=$TAG_NAME" >> "$GITHUB_OUTPUT"

- name: Update package.json with tag version
id: update-version
run: |
TAG_NAME="${{ steps.tag.outputs.name }}"
# Remove 'v' prefix if present
VERSION=${TAG_NAME#v}
npm version "$VERSION" --no-git-tag-version
echo "version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Install project modules
run: npm ci

Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,8 @@ jobs:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run Publish pipeline
uses: ./.github/workflows/publish.yml
with:
branch: "release/v${{ steps.bump.outputs.version }}"

Loading