Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: modify workflows to skip publish upon a prerelease #1129

Merged
merged 1 commit into from
Aug 29, 2024
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
23 changes: 15 additions & 8 deletions .github/workflows/esbuild-publish.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
name: esbuild Compilation & npm Publish Workflow

on:
workflow_run:
workflows:
- create-github-release
types:
- completed
workflow_call:
inputs:
branch:
description: 'Set the branch to use for automation tests'
type: string
required: false
default: 'main'
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false
workflow_dispatch:
inputs:
branch:
Expand All @@ -14,22 +21,22 @@ on:
required: false
default: 'main'
nodeVersion:
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
description: version of node to use. It's better to specify latest, lts/* or lts/-1 than to hardode numbers
type: string
default: lts/*
required: false

jobs:
build:
runs-on: ubuntu-latest
if: ${{ inputs.branch || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success')}}
if: ${{ inputs.branch }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.branch }}
- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.nodeVersion || 'lts/*' }}
node-version: ${{ inputs.nodeVersion }}
registry-url: 'https://registry.npmjs.org'
cache: yarn
- uses: salesforcecli/github-workflows/.github/actions/yarnInstallWithRetries@main
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/onRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,12 @@ jobs:
tag: ${{ needs.getDistTag.outputs.tag || 'latest' }}
githubTag: ${{ github.event.release.tag_name || inputs.tag }}
secrets: inherit

publish-bundle:
if: ${{ success() && needs.getDistTag.outputs.tag == '' }}
uses: ./.github/workflows/esbuild-publish.yml
needs: [getDistTag, npm]
with:
branch: 'main'
nodeVersion: 'lts/*'
secrets: inherit
Loading