Skip to content

Commit

Permalink
Fix CICD[4]
Browse files Browse the repository at this point in the history
  • Loading branch information
cvetty committed Jun 28, 2024
1 parent c1afce4 commit 07bc5f9
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions .github/workflows/pre-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v4
with:
path: krait-ui

- run: pwd

- run: ls -la
ref: main
lfs: false

- name: Install NodeJS
uses: actions/setup-node@v4
Expand All @@ -52,7 +49,7 @@ jobs:
registry-url: 'https://registry.npmjs.org'

- name: Install dependencies
run: npm ci
run: cd krait-ui && npm ci

- name: Configure github user
run: |
Expand All @@ -69,7 +66,9 @@ jobs:
- name: Update the beta version
id: create_tag
run: |
cd krait-ui
TAG=$(npm version prerelease --preid=beta -m "[GHA] Update package version to %s")
cd ../
git push
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
git push --tags
Expand Down Expand Up @@ -132,7 +131,8 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v4
with:
path: krait-ui
ref: main
lfs: false

- name: Install NodeJS
uses: actions/setup-node@v4
Expand All @@ -152,14 +152,13 @@ jobs:
- name: Install npm dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
run: cd krait-ui && npm ci

- name: Build FE assets
run: npm run build
run: cd krait-ui && npm run build

- name: Zip the distribution build
if: needs.init-environment.outputs.is_deployment_pipeline == 'true'
run: zip -9qry "distribution-package.zip" "./" -i "dist/*" "package.json" "package-lock.json"
run: cd krait-ui && zip -9qry "distribution-package.zip" "./" -i "dist/*" "package.json" "package-lock.json"

- name: Upload an Asset in GitHub Release
uses: actions/github-script@v6
Expand All @@ -173,12 +172,12 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
release_id: ${{ env.RELEASE_ID }},
data: await fs.readFile('./distribution-package.zip')
data: await fs.readFile('./krait-ui/distribution-package.zip')
});
env:
RELEASE_ID: ${{ needs.prerelease.outputs.release_id }}

- name: Publish the NPM package
run: npm publish --access public --tag dev
run: cd krait-ui && npm publish --access public --tag dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

0 comments on commit 07bc5f9

Please sign in to comment.