This repository has been archived by the owner on Mar 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release pipeline - there were issues in updating version
- Loading branch information
Showing
1 changed file
with
38 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,21 +42,10 @@ jobs: | |
if [[ $MAJOR == '3' ]]; then MAJOR_NAME="petronas"; fi | ||
echo "major_name=${MAJOR_NAME}" >> $GITHUB_OUTPUT | ||
outputs: | ||
version: ${{ steps.split.outputs.version }} | ||
stage: ${{ steps.split.outputs.stage }} | ||
major_name: ${{ steps.split.outputs.major_name }} | ||
|
||
# Build artifact for deployment | ||
build: | ||
name: Build deployment artifact | ||
runs-on: ubuntu-latest | ||
needs: version | ||
env: | ||
version: ${{ needs.version.outputs.version }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Get branch on which the tag is based | ||
id: branchname | ||
|
@@ -67,24 +56,53 @@ jobs: | |
branch=$(echo $raw | sed 's/.*origin\///') | ||
echo "branch=${branch}" >> $GITHUB_OUTPUT | ||
- name: Checkout branch on which tag was pushed | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ env.branch }} | ||
token: ${{ secrets.COMMIT_PAT }} | ||
|
||
- name: Update UI version in package.json | ||
env: | ||
version: ${{ steps.split.outputs.version }} | ||
run: | | ||
npm version --no-git-tag-version --allow-same-version $version | ||
- name: Set up Node.js version | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "20.x" | ||
|
||
- name: Commit updated version | ||
env: | ||
version: ${{ steps.split.outputs.version }} | ||
branch: ${{ steps.branchname.outputs.branch }} | ||
run: | | ||
git config --local user.name github-actions | ||
git config --local user.email [email protected] | ||
git add * | ||
git commit -m "Updated the version to ${version}" | ||
git push origin HEAD:$branch | ||
outputs: | ||
version: ${{ steps.split.outputs.version }} | ||
stage: ${{ steps.split.outputs.stage }} | ||
major_name: ${{ steps.split.outputs.major_name }} | ||
branch: ${{ steps.branchname.outputs.branch }} | ||
|
||
# Build artifact for deployment | ||
build: | ||
name: Build deployment artifact | ||
runs-on: ubuntu-latest | ||
needs: version | ||
env: | ||
version: ${{ needs.version.outputs.version }} | ||
branch: ${{ needs.version.outputs.branch }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{env.branch}} | ||
|
||
- name: Set up Node.js version | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: "20.x" | ||
|
||
- name: npm install, build, and test | ||
run: | | ||
|