diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3afcb18..8f70d50 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -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 }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 598a585..4559515 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,11 +3,10 @@ name: Publish on: - workflow_run: - workflows: ["Integration Tests"] - types: - - completed + workflow_dispatch: push: + branches: + - main tags: - 'v*.*.*' @@ -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 @@ -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 @@ -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: diff --git a/.github/workflows/push-to-registry.yml b/.github/workflows/push-to-registry.yml index 1bf89b2..f72d467 100644 --- a/.github/workflows/push-to-registry.yml +++ b/.github/workflows/push-to-registry.yml @@ -3,14 +3,12 @@ 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 @@ -18,19 +16,6 @@ env: 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 @@ -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 @@ -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