From 8f08d1a5761035f7674cd271e117c31a629be9f0 Mon Sep 17 00:00:00 2001 From: Jelte van Boheemen Date: Tue, 18 Jun 2024 15:36:54 +0200 Subject: [PATCH 1/5] v0.9.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 108fc894..8c4b1952 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sasta", - "version": "0.9.4", + "version": "0.9.5", "description": "Annotate and analyze transcripts", "author": "UU Digital Humanities Lab", "license": "BSD-3-Clause", From ab174a4a3e1656a0e94b4f13649a042be24e42de Mon Sep 17 00:00:00 2001 From: Jelte van Boheemen Date: Tue, 18 Jun 2024 15:37:42 +0200 Subject: [PATCH 2/5] Add release github action to auto bump versions --- .github/workflows/release.yml | 25 ++++++++++++++++++++++ frontend/.gitignore | 4 ++++ frontend/build/build-pre.js | 39 +++++++++++++++++++++++++++++++++++ frontend/package.json | 3 +++ 4 files changed, 71 insertions(+) create mode 100644 .github/workflows/release.yml create mode 100644 frontend/build/build-pre.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..ed2bc732 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,25 @@ +# This action will update the CITATION.cff file for new release or hotfix branches + +name: Release + +on: + push: + branches: + - 'release/**' + - 'hotfix/**' + +jobs: + citation-update: + name: Update CITATION.cff + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Autoformat CITATION.cff + run: | + version=`grep -o '\d\+\.\d\+\.\d\+' package.json` + today=`date +"%Y-%m-%d"` + sed -i "s/^version: [[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}/version: $version/" CITATION.cff + sed -i "s/[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}/$today/" CITATION.cff + bash ./update-citation.sh + git commit -a -m "update version and date in CITATION.cff" + diff --git a/frontend/.gitignore b/frontend/.gitignore index 13bccaee..6325ef08 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -49,3 +49,7 @@ Thumbs.db # Angular .angular/ + + +/src/environments/environment.prod.ts +/src/environments/version.ts diff --git a/frontend/build/build-pre.js b/frontend/build/build-pre.js new file mode 100644 index 00000000..df212aa6 --- /dev/null +++ b/frontend/build/build-pre.js @@ -0,0 +1,39 @@ +const path = require('path'); +const colors = require('colors/safe'); +const fs = require('fs'); + +console.log(colors.cyan('\nRunning pre-build tasks')); + +var appVersion; + +try { + appVersion = require('../../package.json').version; +} catch { + console.warn('Could not import package.json.'); + appVersion = undefined; +} + +const versionFilePath = path.join( + __dirname + '/../src/environments/version.ts' +); +const src = `export const version = '${appVersion}'; +`; + +// ensure version module pulls value from package.json +fs.writeFile(versionFilePath, src, { flat: 'w' }, function (err) { + if (err) { + return console.log(colors.red(err)); + } + + console.log( + colors.green( + `Updating application version ${colors.yellow(appVersion)}` + ) + ); + console.log( + `${colors.green('Writing version module to ')}${colors.yellow( + versionFilePath + )}\n` + ); + console.log(src); +}); diff --git a/frontend/package.json b/frontend/package.json index 36920c5d..1b1d14c6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -6,6 +6,9 @@ "build": "ng build --base-href=/static/", "test": "ng test --watch=true", "lint": "ng lint", + "prebuild": "node ./build/build-pre.js", + "pretest": "yarn prebuild", + "preserve": "yarn prebuild", "build:en": "ng build --configuration=production-en", "build:nl": "ng build --configuration=production-nl", "build-git": "ng build --configuration git --aot", From 2ae095bdad45c2877f9fc545e727f55a4048843c Mon Sep 17 00:00:00 2001 From: Jelte van Boheemen Date: Tue, 18 Jun 2024 15:41:41 +0200 Subject: [PATCH 3/5] Debug release action --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ed2bc732..288dc242 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,9 +17,10 @@ jobs: - name: Autoformat CITATION.cff run: | version=`grep -o '\d\+\.\d\+\.\d\+' package.json` + echo $version today=`date +"%Y-%m-%d"` + echo $today sed -i "s/^version: [[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}/version: $version/" CITATION.cff sed -i "s/[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}/$today/" CITATION.cff - bash ./update-citation.sh git commit -a -m "update version and date in CITATION.cff" From fe3b6c32caff80845ecdfe81cd20c21ce9161b1a Mon Sep 17 00:00:00 2001 From: Jelte van Boheemen Date: Tue, 18 Jun 2024 16:30:28 +0200 Subject: [PATCH 4/5] Move release action to yarn script --- .github/workflows/release.yml | 26 -------------------------- CITATION.cff | 4 ++-- frontend/src/environments/version.ts | 2 -- package.json | 6 +++++- update-citation.sh | 4 ++++ 5 files changed, 11 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 frontend/src/environments/version.ts create mode 100755 update-citation.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 288dc242..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,26 +0,0 @@ -# This action will update the CITATION.cff file for new release or hotfix branches - -name: Release - -on: - push: - branches: - - 'release/**' - - 'hotfix/**' - -jobs: - citation-update: - name: Update CITATION.cff - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Autoformat CITATION.cff - run: | - version=`grep -o '\d\+\.\d\+\.\d\+' package.json` - echo $version - today=`date +"%Y-%m-%d"` - echo $today - sed -i "s/^version: [[:digit:]]\{1,\}\.[[:digit:]]\{1,\}\.[[:digit:]]\{1,\}/version: $version/" CITATION.cff - sed -i "s/[[:digit:]]\{4\}-[[:digit:]]\{2\}-[[:digit:]]\{2\}/$today/" CITATION.cff - git commit -a -m "update version and date in CITATION.cff" - diff --git a/CITATION.cff b/CITATION.cff index 561b4873..80321bf0 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -41,5 +41,5 @@ abstract: >- transcripts, to aid clinical linguists and research into language development and language disorders. license: BSD-3-Clause -version: 0.9.4 -date-released: '2024-06-11' +version: 0.9.5 +date-released: '2024-06-18' diff --git a/frontend/src/environments/version.ts b/frontend/src/environments/version.ts deleted file mode 100644 index 10bb0086..00000000 --- a/frontend/src/environments/version.ts +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: Compile this from toplevel package.json -export const version = '0.9.4'; diff --git a/package.json b/package.json index 8c4b1952..1f3c467d 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,10 @@ "static-p": "yarn build-p && yarn clean-static && yarn collectstatic-p", "watch-front-p": "yarn front yarn watch", "start-back-p": "cd backend && python manage.py runserver --settings production --insecure --pythonpath ..", - "start-p": "yarn static-p && yarn watch-front-p & yarn start-back-p" + "start-p": "yarn static-p && yarn watch-front-p & yarn start-back-p", + "patch": "yarn version --patch --no-commit-hooks --no-git-tag-version && yarn update-citation && yarn fyarn prebuild", + "minor": "yarn version --minor --no-commit-hooks --no-git-tag-version && yarn update-citation && yarn fyarn prebuild", + "major": "yarn version --major --no-commit-hooks --no-git-tag-version && yarn update-citation && yarn fyarn prebuild", + "update-citation": "$PWD/update-citation.sh" } } diff --git a/update-citation.sh b/update-citation.sh new file mode 100755 index 00000000..fc777af7 --- /dev/null +++ b/update-citation.sh @@ -0,0 +1,4 @@ +version=`grep -o '\d\+\.\d\+\.\d\+' package.json` +today=`date +'%Y-%m-%d'` +sed -i '' "s/^version:.*$/version: $version/g" CITATION.cff +sed -i '' "s/^date-released:.*$/date-released: \'$today\'/g" CITATION.cff From c7ca4a088ec05a5824907f810dbb7fe4eaf04dcd Mon Sep 17 00:00:00 2001 From: Jelte van Boheemen Date: Tue, 18 Jun 2024 16:36:57 +0200 Subject: [PATCH 5/5] Bump sastadev to 0.2.3 --- backend/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/requirements.txt b/backend/requirements.txt index 517786ab..12a557b2 100644 --- a/backend/requirements.txt +++ b/backend/requirements.txt @@ -215,7 +215,7 @@ requests==2.28.1 # spacy requests-oauthlib==1.3.1 # via django-allauth -sastadev==0.2.2 +sastadev==0.2.3 # via # -r requirements.in # auchann