From 2efb98310c02ec92e11e0f550a3bbd1fa532b096 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:11:10 -0500 Subject: [PATCH 01/28] init test --- .github/workflows/repo.yml | 144 ++++++++++++++++++ .../formioreport/formioreport.component.ts | 2 +- 2 files changed, 145 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/repo.yml diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml new file mode 100644 index 00000000..0f866fb4 --- /dev/null +++ b/.github/workflows/repo.yml @@ -0,0 +1,144 @@ +name: Publish + +on: + pull_request: + types: [opened, synchronize] + +env: + NODE_VERSION: 20.x + +jobs: + ##################################################################### + ## Setup + ##################################################################### + setup: + runs-on: ubuntu-latest + steps: + - run: echo "Triggered by ${{ github.event_name }} event." + + - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} + uses: actions/checkout@v3 + + - name: Set up Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + + - name: Cache node modules + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Installing dependencies + if: steps.cache.outputs.cache-hit != 'true' + uses: borales/actions-yarn@v4 + with: + cmd: install --frozen-lockfile + + # - name: Lint + # uses: borales/actions-yarn@v4 + # with: + # cmd: lint + + ##################################################################### + ## Build + ##################################################################### + build: + needs: setup + runs-on: ubuntu-latest + steps: + - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} + uses: actions/checkout@v3 + + - name: Restore node modules from cache + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Build + uses: borales/actions-yarn@v4 + with: + cmd: build + + ##################################################################### + ## Test + ##################################################################### + # test: + # needs: setup + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} + # uses: actions/checkout@v3 + + # - name: Restore node modules from cache + # uses: actions/cache@v3 + # with: + # path: node_modules + # key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-node- + + # - name: Test + # uses: borales/actions-yarn@v4 + # with: + # cmd: test + + ##################################################################### + ## Publish + ##################################################################### + publish: + needs: [setup, build] + if: ${{ github.event_name == 'pull_request' && (github.event.action == 'opened' || github.event.action == 'synchronize') }} + runs-on: ubuntu-latest + steps: + - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} + uses: actions/checkout@v3 + + - name: Configure Git user + run: | + git config --global user.email "pkgbot@form.io" + git config --global user.name "pkgbot" + + - name: Add npm token to .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + + - name: Set up Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v3 + with: + node-version: ${{ env.NODE_VERSION }} + cache: 'npm' + registry-url: 'https://registry.npmjs.org/' + + - name: Restore node modules from cache + uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Prepare version for publish + id: prep + run: | + PR_NUMBER=$(echo ${{ github.event.number }}) + COMMIT_SHORT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-7) + CURRENT_VERSION=$(node -p "require('./package.json').version") + NEW_VERSION="${CURRENT_VERSION}-dev.${PR_NUMBER}.${COMMIT_SHORT_SHA}" + echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV + + - name: Echo version to Publish + run: | + echo "Version to publish: $NEW_VERSION" + + # - name: Publish to npm + # run: | + # npm version $NEW_VERSION + # npm publish --tag dev \ No newline at end of file diff --git a/projects/angular-formio/src/components/formioreport/formioreport.component.ts b/projects/angular-formio/src/components/formioreport/formioreport.component.ts index 2c8de4c5..46a2153e 100644 --- a/projects/angular-formio/src/components/formioreport/formioreport.component.ts +++ b/projects/angular-formio/src/components/formioreport/formioreport.component.ts @@ -17,7 +17,7 @@ export class FormioReportComponent extends FormioComponent implements OnInit, On @Output() fetchDataError = new EventEmitter(); @ViewChild('report', { static: true }) declare formioElement?: ElementRef; - public isLoading: boolean; + // public isLoading: boolean; // Was not allowing yarn build setFormFromSrc() { this.service.loadSubmission({ params: { live: 1 } }).subscribe( From fab349345dc7aac40471c762b101c4de27d36a96 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:15:29 -0500 Subject: [PATCH 02/28] Run publish --- .github/workflows/repo.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 0f866fb4..1b261148 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -138,7 +138,7 @@ jobs: run: | echo "Version to publish: $NEW_VERSION" - # - name: Publish to npm - # run: | - # npm version $NEW_VERSION - # npm publish --tag dev \ No newline at end of file + - name: Publish to npm + run: | + npm version $NEW_VERSION + npm publish --tag dev \ No newline at end of file From 59c1672300302a65f1263c7eaa0169e313225585 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:35:31 -0500 Subject: [PATCH 03/28] View unclean directory --- .github/workflows/repo.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 1b261148..12f8d84c 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -140,5 +140,6 @@ jobs: - name: Publish to npm run: | - npm version $NEW_VERSION - npm publish --tag dev \ No newline at end of file + git status + # npm version $NEW_VERSION + # npm publish --tag dev \ No newline at end of file From 8098c840af52ddc1e5b01ed6b5a9c792ce7666d1 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:43:09 -0500 Subject: [PATCH 04/28] Adding --no-git-tag-version to npm version --- .github/workflows/repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 12f8d84c..f3529199 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -141,5 +141,5 @@ jobs: - name: Publish to npm run: | git status - # npm version $NEW_VERSION + # npm version $NEW_VERSION --no-git-tag-version # npm publish --tag dev \ No newline at end of file From eadad3a243360315d8497519859beebcd28e056c Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:44:00 -0500 Subject: [PATCH 05/28] Forgot to uncomment --- .github/workflows/repo.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index f3529199..29b36895 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -140,6 +140,5 @@ jobs: - name: Publish to npm run: | - git status - # npm version $NEW_VERSION --no-git-tag-version - # npm publish --tag dev \ No newline at end of file + npm publish --tag dev + npm version $NEW_VERSION --no-git-tag-version \ No newline at end of file From 2e45ec86e3e61754f8cf05afb8945ed65e13f1e4 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:46:36 -0500 Subject: [PATCH 06/28] Not sure how these got backwards --- .github/workflows/repo.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 29b36895..e0a4bf64 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -140,5 +140,6 @@ jobs: - name: Publish to npm run: | + npm version $NEW_VERSION --no-git-tag-version npm publish --tag dev - npm version $NEW_VERSION --no-git-tag-version \ No newline at end of file + \ No newline at end of file From edbc24efc8c3900ee4df37ec6d03e34621b25fa4 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:53:56 -0500 Subject: [PATCH 07/28] Seems the reason is due to the existence of publish in package.json --- .github/workflows/repo.yml | 2 +- package.json | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index e0a4bf64..62b8f35e 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -141,5 +141,5 @@ jobs: - name: Publish to npm run: | npm version $NEW_VERSION --no-git-tag-version - npm publish --tag dev + npm publish:dev \ No newline at end of file diff --git a/package.json b/package.json index 1f9e5ab0..9c400e00 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,7 @@ "docs:build": "compodoc -p tsconfig.json -n angular-formio -d docs --hideGenerator", "docs:serve": "npm run docs:build -- -s", "docs:watch": "npm run docs:build -- -s -w", + "publish:dev": "npm run build:prod && npm publish ./dist/angular-formio --tag=dev", "publish": "npm run build:prod && npm publish ./dist/angular-formio --tag=rc", "publish:latest": "npm run build:prod && npm publish ./dist/angular-formio", "test": "ng test", From 4598086073720e2bd3dfbd4a5233052a0e945127 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 12:58:53 -0500 Subject: [PATCH 08/28] Add run --- .github/workflows/repo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 62b8f35e..5deeab4a 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -141,5 +141,5 @@ jobs: - name: Publish to npm run: | npm version $NEW_VERSION --no-git-tag-version - npm publish:dev + npm run publish:dev \ No newline at end of file From e2d3f52897ad8f32b090a84986f18a5b2181d25f Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 13:20:05 -0500 Subject: [PATCH 09/28] restore build cache and run publish --- .github/workflows/repo.yml | 32 +++++++++++++++++++++++++++++--- package.json | 1 - 2 files changed, 29 insertions(+), 4 deletions(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 5deeab4a..1ddc9c5c 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -65,7 +65,19 @@ jobs: - name: Build uses: borales/actions-yarn@v4 with: - cmd: build + cmd: build:prod + + - name: Show build directory contents + run: | + ls -R ./dist/angular-formio + + - name: Cache build directory + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} + restore-keys: | + ${{ runner.os }}-dist- ##################################################################### ## Test @@ -138,8 +150,22 @@ jobs: run: | echo "Version to publish: $NEW_VERSION" + - name: Echo version to Publish + run: | + echo "Version to publish: $NEW_VERSION" + + # Restore Build cache + - name: Restore build cache + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} + restore-keys: | + ${{ runner.os }}-dist- + - name: Publish to npm run: | - npm version $NEW_VERSION --no-git-tag-version - npm run publish:dev + cd ./dist/angular-formio + npm version $NEW_VERSION + npm publish --tag=dev \ No newline at end of file diff --git a/package.json b/package.json index 9c400e00..1f9e5ab0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "docs:build": "compodoc -p tsconfig.json -n angular-formio -d docs --hideGenerator", "docs:serve": "npm run docs:build -- -s", "docs:watch": "npm run docs:build -- -s -w", - "publish:dev": "npm run build:prod && npm publish ./dist/angular-formio --tag=dev", "publish": "npm run build:prod && npm publish ./dist/angular-formio --tag=rc", "publish:latest": "npm run build:prod && npm publish ./dist/angular-formio", "test": "ng test", From b2f21b756489adbdbaccfee6f6cc36e4514516c4 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 20 Mar 2024 13:38:08 -0500 Subject: [PATCH 10/28] Change directory where git user and npmrc occur --- .github/workflows/repo.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/repo.yml b/.github/workflows/repo.yml index 1ddc9c5c..93c68a4a 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/repo.yml @@ -113,15 +113,6 @@ jobs: - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} uses: actions/checkout@v3 - - name: Configure Git user - run: | - git config --global user.email "pkgbot@form.io" - git config --global user.name "pkgbot" - - - name: Add npm token to .npmrc - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - name: Set up Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v3 with: @@ -163,9 +154,20 @@ jobs: restore-keys: | ${{ runner.os }}-dist- + - name: Switch to build directory + run: cd ./dist/angular-formio + + - name: Configure Git user + run: | + git config --global user.email "pkgbot@form.io" + git config --global user.name "pkgbot" + + - name: Add npm token to .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - name: Publish to npm run: | - cd ./dist/angular-formio npm version $NEW_VERSION npm publish --tag=dev \ No newline at end of file From 72ce0cdac9f8fad5d151f32af651914c2bb7484e Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:33:49 -0500 Subject: [PATCH 11/28] test --- .github/workflows/{repo.yml => ci.yml} | 63 +++++++++++++------------- 1 file changed, 31 insertions(+), 32 deletions(-) rename .github/workflows/{repo.yml => ci.yml} (85%) diff --git a/.github/workflows/repo.yml b/.github/workflows/ci.yml similarity index 85% rename from .github/workflows/repo.yml rename to .github/workflows/ci.yml index 93c68a4a..dc926d86 100644 --- a/.github/workflows/repo.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,4 @@ -name: Publish +name: Build, Publish on: pull_request: @@ -80,7 +80,7 @@ jobs: ${{ runner.os }}-dist- ##################################################################### - ## Test + ## Test (Trys to launch a chrome browser, will need additional work) ##################################################################### # test: # needs: setup @@ -113,6 +113,15 @@ jobs: - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} uses: actions/checkout@v3 + - name: Configure Git user + run: | + git config --global user.email "pkgbot@form.io" + git config --global user.name "pkgbot" + + - name: Add npm token to .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - name: Set up Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v3 with: @@ -128,46 +137,36 @@ jobs: restore-keys: | ${{ runner.os }}-node- + - name: Build + uses: borales/actions-yarn@v4 + with: + cmd: build + - name: Prepare version for publish id: prep run: | + # Extract the pull request number and the short SHA of the commit PR_NUMBER=$(echo ${{ github.event.number }}) COMMIT_SHORT_SHA=$(echo "${{ github.event.pull_request.head.sha }}" | cut -c1-7) + + # Extract the current version from package.json CURRENT_VERSION=$(node -p "require('./package.json').version") - NEW_VERSION="${CURRENT_VERSION}-dev.${PR_NUMBER}.${COMMIT_SHORT_SHA}" + + # Get base SemVer to us for new dev version + BASE_VERSION=$(echo "$CURRENT_VERSION" | cut -d'-' -f1) + + # Construct the new version string + NEW_VERSION="${BASE_VERSION}-dev.${PR_NUMBER}.${COMMIT_SHORT_SHA}" + + # Output the new version for use in subsequent GitHub Actions steps echo "NEW_VERSION=$NEW_VERSION" >> $GITHUB_ENV - name: Echo version to Publish run: | echo "Version to publish: $NEW_VERSION" - - name: Echo version to Publish - run: | - echo "Version to publish: $NEW_VERSION" - - # Restore Build cache - - name: Restore build cache - uses: actions/cache@v3 - with: - path: dist - key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} - restore-keys: | - ${{ runner.os }}-dist- - - - name: Switch to build directory - run: cd ./dist/angular-formio - - - name: Configure Git user - run: | - git config --global user.email "pkgbot@form.io" - git config --global user.name "pkgbot" - - - name: Add npm token to .npmrc - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - - name: Publish to npm - run: | - npm version $NEW_VERSION - npm publish --tag=dev + # - name: Publish to npm + # run: | + # npm version $NEW_VERSION + # npm publish --tag=dev \ No newline at end of file From 0378d723a9cc6173f3fa3f5eafbe7406689c9907 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:37:57 -0500 Subject: [PATCH 12/28] Publish Dry run --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc926d86..b1d69faf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,8 +165,8 @@ jobs: run: | echo "Version to publish: $NEW_VERSION" - # - name: Publish to npm - # run: | - # npm version $NEW_VERSION - # npm publish --tag=dev + - name: Publish to npm + run: | + npm version $NEW_VERSION + npm publish --tag=dev \ No newline at end of file From 7fccf00bf64e86de9fef7ec3afb142a64bd816f2 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:40:55 -0500 Subject: [PATCH 13/28] View git status for unclean directory --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1d69faf..1e0ccb3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,9 +164,10 @@ jobs: - name: Echo version to Publish run: | echo "Version to publish: $NEW_VERSION" + git status - - name: Publish to npm - run: | - npm version $NEW_VERSION - npm publish --tag=dev + # - name: Publish to npm + # run: | + # npm version $NEW_VERSION + # npm publish --tag=dev \ No newline at end of file From 8c9f7fdf4c8f79045dad8b051aa914be0455779f Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:43:06 -0500 Subject: [PATCH 14/28] Navigate to the dir and publish --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1e0ccb3e..3d8bb7ad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,9 +165,10 @@ jobs: run: | echo "Version to publish: $NEW_VERSION" git status + cd ./dist/angular-formio - # - name: Publish to npm - # run: | - # npm version $NEW_VERSION - # npm publish --tag=dev + - name: Publish to npm + run: | + npm version $NEW_VERSION + npm publish --tag=dev \ No newline at end of file From 3c232c0d67143449eb8d936f9bbc8f97d4ba8ac3 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:47:03 -0500 Subject: [PATCH 15/28] Moves the npm token around --- .github/workflows/ci.yml | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d8bb7ad..b3f75ff6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,14 +70,6 @@ jobs: - name: Show build directory contents run: | ls -R ./dist/angular-formio - - - name: Cache build directory - uses: actions/cache@v3 - with: - path: dist - key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} - restore-keys: | - ${{ runner.os }}-dist- ##################################################################### ## Test (Trys to launch a chrome browser, will need additional work) @@ -113,15 +105,6 @@ jobs: - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} uses: actions/checkout@v3 - - name: Configure Git user - run: | - git config --global user.email "pkgbot@form.io" - git config --global user.name "pkgbot" - - - name: Add npm token to .npmrc - run: | - echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - - name: Set up Node.js ${{ env.NODE_VERSION }} uses: actions/setup-node@v3 with: @@ -140,7 +123,11 @@ jobs: - name: Build uses: borales/actions-yarn@v4 with: - cmd: build + cmd: build:prod + + - name: Show dist directory contents + run: | + ls -R ./dist/angular-formio - name: Prepare version for publish id: prep @@ -164,9 +151,17 @@ jobs: - name: Echo version to Publish run: | echo "Version to publish: $NEW_VERSION" - git status cd ./dist/angular-formio + - name: Configure Git user + run: | + git config --global user.email "pkgbot@form.io" + git config --global user.name "pkgbot" + + - name: Add npm token to .npmrc + run: | + echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc + - name: Publish to npm run: | npm version $NEW_VERSION From 3b0b971785312f9680a935a19d768ad7de75679f Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:51:52 -0500 Subject: [PATCH 16/28] Getting unclean dir --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b3f75ff6..94cdc942 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,6 +164,7 @@ jobs: - name: Publish to npm run: | + git status npm version $NEW_VERSION npm publish --tag=dev \ No newline at end of file From 8de367735c4485aa4b59326f6a17b80b831ecac4 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 10:54:38 -0500 Subject: [PATCH 17/28] try adding .npmrc to ignore --- .gitignore | 2 ++ .npmignore | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 1f1d592b..cda97f59 100644 --- a/.gitignore +++ b/.gitignore @@ -47,3 +47,5 @@ testem.log # System Files .DS_Store Thumbs.db + +.npmrc \ No newline at end of file diff --git a/.npmignore b/.npmignore index fdb7f4f4..b41ea20f 100644 --- a/.npmignore +++ b/.npmignore @@ -32,3 +32,5 @@ Desktop.ini # Library files src/* build/* + +.npmrc \ No newline at end of file From f7c9795fa810f5c3cd7637abe3c1998d0c05d0aa Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 11:13:43 -0500 Subject: [PATCH 18/28] Adds --no-git-tag-version so will by pass the modifications to .npmrc --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94cdc942..eaa59db0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: - name: Publish to npm run: | - git status - npm version $NEW_VERSION + # git status + npm version $NEW_VERSION --no-git-tag-version npm publish --tag=dev \ No newline at end of file From 48ab78dc73403abd9f5dd4fd2a739ee76b789f42 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 11:24:34 -0500 Subject: [PATCH 19/28] Try from cache again --- .github/workflows/ci.yml | 41 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index eaa59db0..38d38f7b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -70,6 +70,14 @@ jobs: - name: Show build directory contents run: | ls -R ./dist/angular-formio + + - name: Cache build directory + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} + restore-keys: | + ${{ runner.os }}-dist- ##################################################################### ## Test (Trys to launch a chrome browser, will need additional work) @@ -112,23 +120,6 @@ jobs: cache: 'npm' registry-url: 'https://registry.npmjs.org/' - - name: Restore node modules from cache - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-node- - - - name: Build - uses: borales/actions-yarn@v4 - with: - cmd: build:prod - - - name: Show dist directory contents - run: | - ls -R ./dist/angular-formio - - name: Prepare version for publish id: prep run: | @@ -151,7 +142,18 @@ jobs: - name: Echo version to Publish run: | echo "Version to publish: $NEW_VERSION" - cd ./dist/angular-formio + + # Restore Build cache + - name: Restore build cache + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} + restore-keys: | + ${{ runner.os }}-dist- + + - name: Switch to dist directory + run: cd ./dist/angular-formio - name: Configure Git user run: | @@ -164,7 +166,6 @@ jobs: - name: Publish to npm run: | - # git status - npm version $NEW_VERSION --no-git-tag-version + npm version $NEW_VERSION npm publish --tag=dev \ No newline at end of file From b272e2538794843bb1e5025da46bbc7f4567bfef Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 11:25:20 -0500 Subject: [PATCH 20/28] seems like it will fail without no-git-tag but still push --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38d38f7b..fc314fca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,6 @@ jobs: - name: Publish to npm run: | - npm version $NEW_VERSION + npm version $NEW_VERSION --no-git-tag-version npm publish --tag=dev \ No newline at end of file From f6448ba61cf2264da25be55a234504da8976613b Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 11:31:34 -0500 Subject: [PATCH 21/28] Its not publishing from the correct directory it seems --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc314fca..306a919f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,6 +166,7 @@ jobs: - name: Publish to npm run: | - npm version $NEW_VERSION --no-git-tag-version - npm publish --tag=dev + pwd + # npm version $NEW_VERSION --no-git-tag-version + # npm publish --tag=dev \ No newline at end of file From e61e78ca25aa111e04ce976af8ee175359e504f6 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 11:32:12 -0500 Subject: [PATCH 22/28] directory test --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 306a919f..106c758d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,6 +167,7 @@ jobs: - name: Publish to npm run: | pwd + ls -R . # npm version $NEW_VERSION --no-git-tag-version # npm publish --tag=dev \ No newline at end of file From 59f26eaf673390d027aea6e01710083ed183ae3f Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 12:10:56 -0500 Subject: [PATCH 23/28] Having issues getting it to deploy to correct directory --- .github/workflows/ci.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 106c758d..3d204b40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,7 +153,9 @@ jobs: ${{ runner.os }}-dist- - name: Switch to dist directory - run: cd ./dist/angular-formio + run: | + cd ./dist/angular-formio + ls -R . - name: Configure Git user run: | @@ -168,6 +170,6 @@ jobs: run: | pwd ls -R . - # npm version $NEW_VERSION --no-git-tag-version - # npm publish --tag=dev + npm version $NEW_VERSION --no-git-tag-version + npm publish ./dist/angular-formio --tag=dev \ No newline at end of file From f60579054adcba0e633d655ebc57c42a2537c459 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 12:12:45 -0500 Subject: [PATCH 24/28] switch dirs before creating tag --- .github/workflows/ci.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d204b40..bc209a1e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,6 +119,20 @@ jobs: node-version: ${{ env.NODE_VERSION }} cache: 'npm' registry-url: 'https://registry.npmjs.org/' + + # Restore Build cache + - name: Restore dist cache + uses: actions/cache@v3 + with: + path: dist + key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} + restore-keys: | + ${{ runner.os }}-dist- + + - name: Switch to dist directory + run: | + cd ./dist/angular-formio + ls -R . - name: Prepare version for publish id: prep @@ -142,20 +156,6 @@ jobs: - name: Echo version to Publish run: | echo "Version to publish: $NEW_VERSION" - - # Restore Build cache - - name: Restore build cache - uses: actions/cache@v3 - with: - path: dist - key: ${{ runner.os }}-dist-${{ hashFiles('dist.tgz') }} - restore-keys: | - ${{ runner.os }}-dist- - - - name: Switch to dist directory - run: | - cd ./dist/angular-formio - ls -R . - name: Configure Git user run: | From daa620571d71aa04f9228c2db0ff431550f20f2f Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 12:19:52 -0500 Subject: [PATCH 25/28] Adds working directory to steps --- .github/workflows/ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc209a1e..33860af0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -129,13 +129,14 @@ jobs: restore-keys: | ${{ runner.os }}-dist- - - name: Switch to dist directory - run: | - cd ./dist/angular-formio - ls -R . + # - name: Switch to dist directory + # run: | + # cd ./dist/angular-formio + # ls -R . - name: Prepare version for publish id: prep + working-directory: ./dist/angular-formio run: | # Extract the pull request number and the short SHA of the commit PR_NUMBER=$(echo ${{ github.event.number }}) @@ -158,18 +159,21 @@ jobs: echo "Version to publish: $NEW_VERSION" - name: Configure Git user + working-directory: ./dist/angular-formio run: | git config --global user.email "pkgbot@form.io" git config --global user.name "pkgbot" - name: Add npm token to .npmrc + working-directory: ./dist/angular-formio run: | echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > .npmrc - name: Publish to npm + working-directory: ./dist/angular-formio run: | pwd ls -R . - npm version $NEW_VERSION --no-git-tag-version - npm publish ./dist/angular-formio --tag=dev + npm version $NEW_VERSION + npm publish --tag=dev \ No newline at end of file From 57ea833c9c0f073f67579a7b964d522f2d873299 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 22 Mar 2024 12:23:30 -0500 Subject: [PATCH 26/28] Last minute clean-up --- .github/workflows/ci.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33860af0..93312917 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: run: | ls -R ./dist/angular-formio - - name: Cache build directory + - name: Cache dist directory uses: actions/cache@v3 with: path: dist @@ -172,8 +172,6 @@ jobs: - name: Publish to npm working-directory: ./dist/angular-formio run: | - pwd - ls -R . npm version $NEW_VERSION npm publish --tag=dev \ No newline at end of file From e62b35abf5a98137bd3703f13e907fb13543cf8d Mon Sep 17 00:00:00 2001 From: ryanformio Date: Wed, 3 Apr 2024 14:28:39 -0500 Subject: [PATCH 27/28] Updates with 7848 and uses yarn publish --- .github/workflows/ci.yml | 48 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 45 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93312917..600f10f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: Build, Publish on: pull_request: - types: [opened, synchronize] + types: [opened, synchronize, reopened] env: NODE_VERSION: 20.x @@ -82,7 +82,7 @@ jobs: ##################################################################### ## Test (Trys to launch a chrome browser, will need additional work) ##################################################################### - # test: + # test-current: # needs: setup # runs-on: ubuntu-latest # steps: @@ -102,6 +102,48 @@ jobs: # with: # cmd: test + # test-target: + # needs: setup + # runs-on: ubuntu-latest + # steps: + # - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} + # uses: actions/checkout@v3 + # with: + # fetch-depth: 0 + + # - name: Merge target branch into current branch + # run: | + # git config --global user.email "pkgbot@form.io" + # git config --global user.name "pkgbot" + # git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }} + # git merge ${{ github.event.pull_request.base.ref }} --no-commit --no-ff + # if ! git merge --no-commit --no-ff ${{ github.event.pull_request.base.ref }}; then + # echo "Merge conflicts detected." + # git merge --abort + # exit 1 + # else + # echo "Merge successful." + # fi + + # - name: Set up Node.js ${{ env.NODE_VERSION }} + # uses: actions/setup-node@v3 + # with: + # node-version: ${{ env.NODE_VERSION }} + # cache: 'npm' + + # - name: Restore node modules from cache + # uses: actions/cache@v3 + # with: + # path: node_modules + # key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }} + # restore-keys: | + # ${{ runner.os }}-node- + + # - name: Test + # uses: borales/actions-yarn@v4 + # with: + # cmd: test + ##################################################################### ## Publish ##################################################################### @@ -173,5 +215,5 @@ jobs: working-directory: ./dist/angular-formio run: | npm version $NEW_VERSION - npm publish --tag=dev + yarn publish --tag=dev \ No newline at end of file From 8982fec1222be728a074a00134e6407c99df02f4 Mon Sep 17 00:00:00 2001 From: ryanformio Date: Fri, 3 May 2024 13:41:42 -0500 Subject: [PATCH 28/28] Updates for FIO-8237, and addresses PR comments in formioreport.component.ts --- .github/workflows/ci.yml | 16 ++++++++++++++-- .../formioreport/formioreport.component.ts | 2 -- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 600f10f3..c9f1a454 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,16 +13,19 @@ jobs: ##################################################################### setup: runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x] steps: - run: echo "Triggered by ${{ github.event_name }} event." - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} uses: actions/checkout@v3 - - name: Set up Node.js ${{ env.NODE_VERSION }} + - name: Set up Node.js ${{ matrix.node-version }} uses: actions/setup-node@v3 with: - node-version: ${{ env.NODE_VERSION }} + node-version: ${{ matrix.node-version }} cache: 'npm' - name: Cache node modules @@ -50,10 +53,19 @@ jobs: build: needs: setup runs-on: ubuntu-latest + strategy: + matrix: + node-version: [18.x, 20.x] steps: - name: Check out repository code ${{ github.repository }} on ${{ github.ref }} uses: actions/checkout@v3 + - name: Set up Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + cache: 'npm' + - name: Restore node modules from cache uses: actions/cache@v3 with: diff --git a/projects/angular-formio/src/components/formioreport/formioreport.component.ts b/projects/angular-formio/src/components/formioreport/formioreport.component.ts index 46a2153e..99664460 100644 --- a/projects/angular-formio/src/components/formioreport/formioreport.component.ts +++ b/projects/angular-formio/src/components/formioreport/formioreport.component.ts @@ -17,8 +17,6 @@ export class FormioReportComponent extends FormioComponent implements OnInit, On @Output() fetchDataError = new EventEmitter(); @ViewChild('report', { static: true }) declare formioElement?: ElementRef; - // public isLoading: boolean; // Was not allowing yarn build - setFormFromSrc() { this.service.loadSubmission({ params: { live: 1 } }).subscribe( (report: FormioReport) => {