Skip to content

Commit

Permalink
Release v1.1.1 (#77)
Browse files Browse the repository at this point in the history
* doc(README): update updating instructions
* test: wait a little longer, use path.join
* ci: only attempt publish if package.json modified
  • Loading branch information
msimerson committed Jun 16, 2023
1 parent 00fb6a0 commit 6cf9ccc
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
push:
branches:
- master
paths:
- package.json

env:
CI: true
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```


Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "haraka-tld",
"version": "1.1.0",
"version": "1.1.1",
"description": "Haraka TLD utilities",
"main": "index.js",
"directories": {
Expand Down
18 changes: 9 additions & 9 deletions test/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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) {
Expand Down Expand Up @@ -59,16 +57,17 @@ 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();
}).catch(done)
})

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();
Expand All @@ -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()
Expand Down

0 comments on commit 6cf9ccc

Please sign in to comment.