diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index c295038..9bfdec3 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,8 @@ on: push: branches: - master + paths: + - package.json env: CI: true diff --git a/CHANGELOG.md b/CHANGELOG.md index c3ed7bb..b0d330f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ### Unreleased +### [1.1.1] - 2023-06-16 + +- updated TLD files +- fix: update_tld_files and update installed copies (#76) + + ### [1.1.0] - 2022-09-29 - updated TLD files @@ -178,3 +184,4 @@ [1.0.32]: https://github.com/haraka/haraka-tld/releases/tag/1.0.31 [1.0.34]: https://github.com/haraka/haraka-tld/releases/tag/1.0.33 [1.1.0]: https://github.com/haraka/haraka-tld/releases/tag/1.1.0 +[1.1.1]: https://github.com/haraka/haraka-tld/releases/tag/1.1.1 diff --git a/README.md b/README.md index 43b8db4..94a0c51 100644 --- a/README.md +++ b/README.md @@ -99,15 +99,14 @@ This allows for additional 2nd and 3rd level TLDs from a single file. Used for s ## Updating -* run the update script (see below) -* update Changes.md file -* update version in package.json -* publish to npm +* update the TLD files with `./update_tld_files` +* use the .release scripts to roll a new release. If the .release dir is empty (first time), populate it with `git submodule update --init --recursive`. ```sh -./update_tld_files -.release/do.sh patch -.release/push.sh +.release/start.sh patch +$edit CHANGELOG.md +git add . && git commit +.release/submit.sh ``` diff --git a/index.js b/index.js index 28b3e50..82bb2f0 100644 --- a/index.js +++ b/index.js @@ -223,7 +223,7 @@ load_public_suffix_list(); setInterval(() => { update.updatePSLfile().then(updated => { if (updated) load_public_suffix_list(); - }).catch((err) => { + }).catch(err => { console.error(err.message) }); }, 15 * 86400 * 1000).unref(); // each 15 days diff --git a/package.json b/package.json index 0f6874f..caa208d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "haraka-tld", - "version": "1.1.0", + "version": "1.1.1", "description": "Haraka TLD utilities", "main": "index.js", "directories": { diff --git a/test/update.js b/test/update.js index 85ee611..ba34acc 100644 --- a/test/update.js +++ b/test/update.js @@ -6,22 +6,19 @@ const path = require('path') const update = require('../lib/update') after(function (done) { - fs.unlink(path.join('test', 'fixtures', 'tmpfile'), () => { - done() - }) + fs.unlink(path.join('test', 'fixtures', 'tmpfile'), done) }) describe('getFileStats', function () { it('get fs.stats from default existing PSL', function (done) { update.getFileStats().then((stats) => { - // console.log(stats); assert.ok(stats.size > 10000, stats.size) done() }).catch(done); }) it('returns null from a missing file', function (done) { - update.getFileStats('etc/nonexist').then((stats) => { + update.getFileStats(path.join('etc','nonexist')).then(stats => { assert.equal(stats, null) done(); }).catch(done); @@ -30,6 +27,7 @@ describe('getFileStats', function () { describe('isRemoteNewer', function () { this.slow(500); + this.timeout(3000) it('a HTTP POST returns false if remote file is newer', function (done) { update.isRemoteNewer(null).then(isNewer => { if (isNewer) { @@ -59,8 +57,8 @@ describe('isRemoteNewer', function () { describe('getWritableStream', function () { it('opens a file for writing a stream to', function (done) { - update.getWritableStream('test/fixtures/tmpfile').then(ws => { - // console.log(ws); + const filePath = path.join('test', 'fixtures', 'tmpfile') + update.getWritableStream(filePath).then(ws => { assert.equal(ws.writable, true); ws.close(); done(); @@ -68,7 +66,8 @@ describe('getWritableStream', function () { }) it('throws when it cannot open file', function (done) { - update.getWritableStream('test/fixtures/unwritable/tmpfile') + const filePath = path.join('test', 'fixtures', 'unwritable', 'tmpfile') + update.getWritableStream(filePath) .then(ws => { assert.ok(!ws); // shouldn't ever get here done(); @@ -89,7 +88,8 @@ describe('download', function () { } it('errors if it cannot open tmp file', function (done) { - update.download('test/fixtures/unwritable/test', testOpts) + const filePath = path.join('test', 'fixtures', 'unwritable', 'test') + update.download(filePath, testOpts) .then((installed) => { assert.equal(installed, false); // should never get here done()