Skip to content

Commit

Permalink
fix: Added file existance output
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinshahfws committed Aug 27, 2024
1 parent 85ec06f commit 64e6ad4
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/release-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,13 @@ jobs:
echo "NPM_DIST_TAG=test" >> $GITHUB_ENV
echo "DOCS_TAG=pr-$(node ./src/js/version.mjs branch-to-prerelease ${{ github.head_ref }})" >> $GITHUB_ENV
echo "FEATURE_BRANCH=${{ github.head_ref }}" >> $GITHUB_ENV
# Set file permissions
- name: Set file permissions
run: |
chmod -R 755 ./
chown -R $(id -u):$(id -g) ./
# Perform real (When not a PR) or dry-run (When PR) semantic-release
- name: Release mono-artifact to GitHub
if: (github.ref_name != 'main' && github.event_name != 'pull_request') || github.event_name == 'workflow_dispatch'
Expand All @@ -92,11 +95,8 @@ jobs:
npm version prerelease --preid $PRERELEASE --git-tag-version false
npm version prerelease --preid $PRERELEASE --workspaces --git-tag-version false
npm run dist
# - name: Check if semantic-release created a build
# id: check_build
# uses: andstor/file-existence-action@v2
# with:
# files: './src/sdks/core/dist/lib/firebolt.mjs'
# Check if semantic-release created a build
- name: Check if semantic-release created a build
id: check_build
uses: actions/github-script@v6
Expand All @@ -107,16 +107,17 @@ jobs:
return fs.existsSync(path);
- name: File Existence Output
run: |
echo "File exists: ${{ steps.check_file.outputs.result }}"
echo "File exists: ${{ steps.check_build.outputs.result }}"
- name: Get version from package.json
run: |
RELEASE_VERSION=$(node -p "require('./package.json').version")
echo "RELEASE_VERSION=$RELEASE_VERSION" >> $GITHUB_ENV
echo "build_cpp_source=true" >> $GITHUB_ENV
# Build CPP SDKs for all the instances except PR is merged to main
- name: Set cpp build source Condition
if: steps.check_build.outputs.files_exists == 'false' || (github.ref_name == 'main' && github.event_name != 'pull_request' && github.event_name != 'workflow_dispatch')
run: echo "build_cpp_source=false" >> $GITHUB_ENV

- name: Clone and Install Thunder
if: env.build_cpp_source == 'true'
id: install_thunder
Expand All @@ -142,6 +143,7 @@ jobs:
run: |
.github/workflows/utils.sh buildDiscoveryCPPSDK $RELEASE_VERSION
# Release SDKs to NPM or Dry run
- name: Release Firebolt SDKs to NPM
if: steps.check_build.outputs.files_exists == 'true' && github.event_name != 'pull_request' && (github.ref_name != 'main' || github.event_name == 'workflow_dispatch')
env:
Expand All @@ -155,6 +157,8 @@ jobs:
env:
NPM_TOKEN: ${{ secrets.SEMANTIC_RELEASE_NPM_TOKEN }} # <-- Allows semantic-release to publish to npm without 2 factor auth.
run: npm publish --tag $NPM_DIST_TAG --workspaces --dry-run

# Release docs to GitHub.io
- name: Checkout firebolt GitHub.io repository
if: steps.check_build.outputs.files_exists == 'true'
env:
Expand Down

0 comments on commit 64e6ad4

Please sign in to comment.