Skip to content

fix: connect modal regex #257

fix: connect modal regex

fix: connect modal regex #257

name: Build & Release
on:
push:
tags:
- '**'
pull_request:
branches:
- '**'
concurrency:
# SHA is added to the end if on `main` to let all main workflows run
group: ${{ github.ref }}-${{ github.workflow }}-${{ github.event_name }}-${{ github.ref == 'refs/heads/main' && github.sha || '' }}
cancel-in-progress: true
permissions:
id-token: write
contents: write
env:
APP_NAME: core-registry-dashboard-ui
jobs:
build_web:
name: Build Core Registry Dashboard Web App
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Node 20.16
uses: actions/setup-node@v4
with:
node-version: '20.16'
- name: Install Husky
run: npm install --save-dev husky
- name: Change the package.json version if an RC tag
shell: bash
if: startsWith(github.ref, 'refs/tags/') && contains( github.ref, '-rc')
run: |
echo "Github ref: $GITHUB_REF"
IFS='/' read -r base directory tag <<< "$GITHUB_REF"
echo "Extracted tag is $tag"
jq ".version = \"${tag}\"" package.json > package.tmp
mv package.tmp package.json
- name: npm install and build
run: |
node --version
npm install
npm run web-build
- name: Create .tar.gz of the web build
run: tar -cvzf ${{ env.APP_NAME }}-web-build.tar.gz build
- name: Upload build artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.APP_NAME }}-web-build
path: ${{ env.APP_NAME }}-web-build.tar.gz
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs:
- build_web
steps:
- name: Download Web artifact
uses: actions/download-artifact@v4
with:
name: ${{ env.APP_NAME }}-web-build
path: ${{ env.APP_NAME }}-web-build
- name: Get Filenames
run: |
WEB_FILE=$(find ${{ github.workspace }}/${{ env.APP_NAME }}-web-build/ -type f -name '*.tar.gz')
echo "WEB_FILE=$WEB_FILE" >>$GITHUB_ENV
# RC release should not be set as latest
- name: Decide if release should be set as latest
id: is_latest
shell: bash
run: |
unset IS_LATEST
echo "Github ref is $GITHUB_REF"
if [[ "$GITHUB_REF" =~ "-rc" ]]; then
echo "release candidate tag matched"
IS_LATEST='false'
IS_PRERELEASE='true'
else
echo "main branch release matched"
IS_LATEST='true'
IS_PRERELEASE='false'
fi
echo "IS_LATEST=${IS_LATEST}" >> "$GITHUB_OUTPUT"
echo "IS_PRERELEASE=${IS_PRERELEASE}" >> "$GITHUB_OUTPUT"
- name: Release
uses: softprops/action-gh-release@v2
with:
prerelease: ${{steps.is_latest.outputs.IS_PRERELEASE}}
make_latest: "${{steps.is_latest.outputs.IS_LATEST}}"
files: |
${{ env.WEB_FILE }}