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
2 changes: 1 addition & 1 deletion .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ jobs:
with:
language: javascript
repo-url: ${{ github.repository }}
commit-sha: ${{ github.event.workflow_run && github.event.workflow_run.head_sha || github.sha }}
commit-sha: ${{ github.event_name == 'workflow_dispatch' && github.sha || github.event.workflow_run.head_sha && github.event.workflow_run.head_sha != github.event.workflow_run.base_sha && github.event.workflow_run.head_sha ||github.sha }}
22 changes: 9 additions & 13 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
name: Publish

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

Expand All @@ -17,17 +16,14 @@ permissions:

jobs:
publish-ea:
if: |
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
if: startsWith(github.ref, 'refs/tags/') == false
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_branch }}
ref: ${{ github.ref_name }}
fetch-depth: 0

- name: Install node 24
Expand All @@ -45,9 +41,9 @@ jobs:
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"

- name: Reset to workflow run commit
- name: Reset to commit
run: |
git reset --hard ${{ github.event.workflow_run.head_sha }}
git reset --hard ${{ github.sha }}

- name: Get current version
id: current-version
Expand All @@ -65,13 +61,13 @@ jobs:

- name: Publish package
run: |
SHORT_SHA=$(git rev-parse --short "${{ github.event.workflow_run.head_sha }}")
SHORT_SHA=$(git rev-parse --short "${{ github.sha }}")
EA_VERSION="${{ steps.current-version.outputs.base-version }}-ea.${SHORT_SHA}"
npm version "$EA_VERSION" --no-git-tag-version
npm publish --verbose --tag ea --access public --provenance

publish-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
name: Publish release to NPM
steps:
Expand Down
25 changes: 5 additions & 20 deletions .github/workflows/push-to-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,19 @@
name: Push to registry

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

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push:
if: |
(
github.event_name == 'workflow_run' &&
github.event.workflow_run.event == 'push' &&
github.event.workflow_run.head_branch == 'main'
)
||
(
github.event_name == 'push' &&
startsWith(github.ref, 'refs/tags/')
)
||
github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
permissions:
contents: read
Expand All @@ -55,7 +40,7 @@ jobs:
- name: Determine package version
id: version
run: |
if [ "${GITHUB_EVENT_NAME}" = "push" ] && [[ "${GITHUB_REF}" =~ refs/tags/ ]]; then
if [[ "${GITHUB_REF}" =~ refs/tags/ ]]; then
# Release tag
VERSION="${GITHUB_REF#refs/tags/v}"
EA_BUILD=false
Expand Down Expand Up @@ -107,7 +92,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
IMAGE_VERSION=${{ steps.package-version.outputs.version }}
IMAGE_VERSION=${{ steps.version.outputs.version }}
IMAGE_REVISION=${{ steps.image-meta.outputs.revision }}
IMAGE_CREATED=${{ steps.image-meta.outputs.created }}
cache-from: type=gha
Expand Down
Loading