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
13 changes: 11 additions & 2 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Integration
name: Integration Tests

on:
workflow_run:
workflows: ["Test"]
types:
- completed
workflow_dispatch:
pull_request:
branches:
Expand All @@ -14,8 +18,13 @@ concurrency:

jobs:
call-shared:
# Only run if the test workflow succeeded, or if triggered directly
if: |
(github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') ||
github.event_name == 'workflow_dispatch' ||
github.event_name == 'pull_request'
uses: trustification/exhort-integration-tests/.github/workflows/integration.yml@main
with:
language: javascript
repo-url: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
commit-sha: ${{ github.event.pull_request.head.sha || github.sha }}
commit-sha: ${{ github.event.workflow_run.head_sha || github.event.pull_request.head.sha || github.sha }}
81 changes: 0 additions & 81 deletions .github/workflows/publish-prerelease.yml

This file was deleted.

112 changes: 0 additions & 112 deletions .github/workflows/publish-release.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .github/workflows/publish-switch.yml

This file was deleted.

125 changes: 125 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# yaml-language-server: $schema=https://www.schemastore.org/github-workflow.json
---
name: Publish

on:
workflow_run:
workflows: ["Integration Tests"]
types:
- completed
branches:
- main
push:
tags:
- 'v*.*.*'
- '*.*.*'

permissions:
contents: write
id-token: write

jobs:
publish-ea:
if: |
github.event_name == 'workflow_run' &&
github.event.workflow_run.head_branch == 'main'
runs-on: ubuntu-latest
name: Publish EA release to NPM
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ github.event.workflow_run.head_sha }}
fetch-depth: 0

- name: Install node 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
registry-url: 'https://registry.npmjs.org'

- name: Update npm
run: npm install -g npm@latest

- name: Configure git
run: |
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"

- name: Get current version
id: current-version
run: |
VERSION=$(node -p "require('./package.json').version")
# Remove both -ea. and -ea- formats for compatibility
BASE_VERSION=$(echo "$VERSION" | sed -E 's/-ea[.-][0-9]+$//')
echo "base-version=$BASE_VERSION" >> "$GITHUB_OUTPUT"
echo "current-version=$VERSION" >> "$GITHUB_OUTPUT"

- name: Update package with EA version
id: bump
run: |
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea-${{ github.run_number }}"
npm version "$EA_VERSION" --no-git-tag-version
echo "version=$EA_VERSION" >> "$GITHUB_OUTPUT"

- name: Install project modules
run: npm ci

- name: Compile project
run: npm run compile

- name: Publish package
run: npm publish --verbose --tag ea --access public --provenance

- name: Commit and push package modifications
run: |
git add package.json
git add package-lock.json
git commit -m "build: updated package with ${{ steps.bump.outputs.version }} [skip ci]"
git push

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

- name: Install node 24
uses: actions/setup-node@v5
with:
node-version: 24
cache: npm
registry-url: 'https://registry.npmjs.org'

- 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

- name: Compile project
run: npm run compile

- name: Publish package
run: npm publish --verbose --access public --provenance
Loading
Loading