bsb 1.2.3 → 1.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/publish.yml +41 -0
- data/.github/workflows/release.yml +6 -43
- data/.github/workflows/update_bsb_db.yml +38 -0
- data/.release-please-manifest.json +1 -1
- data/CHANGELOG.md +22 -0
- data/Gemfile +3 -0
- data/README.md +38 -3
- data/Rakefile +1 -0
- data/config/bsb_db.json +945 -0
- data/lib/bsb/aus_pay_net/client.rb +39 -0
- data/lib/bsb/base_generator.rb +2 -0
- data/lib/bsb/database_generator.rb +20 -0
- data/lib/bsb/version.rb +1 -1
- data/lib/bsb.rb +3 -1
- data/lib/bsb_number_validator.rb +1 -1
- data/lib/tasks/bsb_tasks.rake +16 -12
- data/lib/tasks/sync_bsb_db.rake +34 -0
- data/release-please-config.json +11 -0
- data/test/bsb/aus_pay_net/client_test.rb +19 -0
- data/test/fixtures/bsb_db.json +20 -0
- data/test/fixtures/vcr_cassettes/auspaynet_fetch_all_bsbs.yml +80 -0
- data/test/tasks/sync_bsb_db_test.rb +141 -0
- data/test/test_helper.rb +14 -0
- data/test/tmp/.keep +0 -0
- metadata +12 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0add64815db73a3ee279a07aa452900c2edf86535051eb649e012b41c23fdf9
|
4
|
+
data.tar.gz: 280b3dd845356e353c16037d7b3ab56f2fbc52e9d1db2db4f68cd7ef7baa4ad3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 025dbfec0fbb9825eeb87bbe74aface5a6fe47462bb0a979697a2f1e3838ba53c33a679b9b2395f7688ded69b7b3a55047cb7254c1c346899cfd2bcc4d057f9a
|
7
|
+
data.tar.gz: 4c152dbc111081cc6a98126dc998900e2476cdbd6f300af6df1cb58d0a7a396bfd467c5107322456e2fad6a773163eba9fd490c2171e1d7b235fe5c990b1781a
|
@@ -0,0 +1,41 @@
|
|
1
|
+
name: Publish Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
release:
|
6
|
+
types: [published]
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
publish:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
steps:
|
12
|
+
- name: Checkout
|
13
|
+
uses: actions/checkout@v4
|
14
|
+
|
15
|
+
- name: Set up Ruby
|
16
|
+
uses: ruby/setup-ruby@v1
|
17
|
+
with:
|
18
|
+
bundler-cache: true
|
19
|
+
|
20
|
+
- name: Publish to GPR
|
21
|
+
env:
|
22
|
+
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
23
|
+
OWNER: ${{ github.repository_owner }}
|
24
|
+
run: |
|
25
|
+
mkdir -p $HOME/.gem
|
26
|
+
touch $HOME/.gem/credentials
|
27
|
+
chmod 0600 $HOME/.gem/credentials
|
28
|
+
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
29
|
+
gem build *.gemspec
|
30
|
+
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
31
|
+
|
32
|
+
- name: Publish to RubyGems
|
33
|
+
env:
|
34
|
+
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
|
35
|
+
run: |
|
36
|
+
mkdir -p $HOME/.gem
|
37
|
+
touch $HOME/.gem/credentials
|
38
|
+
chmod 0600 $HOME/.gem/credentials
|
39
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
40
|
+
gem build *.gemspec
|
41
|
+
gem push *.gem
|
@@ -5,52 +5,15 @@ on:
|
|
5
5
|
branches:
|
6
6
|
- master
|
7
7
|
|
8
|
+
permissions:
|
9
|
+
contents: write
|
10
|
+
pull-requests: write
|
11
|
+
|
8
12
|
jobs:
|
9
13
|
release-please:
|
10
14
|
runs-on: ubuntu-latest
|
11
15
|
steps:
|
12
|
-
- uses:
|
16
|
+
- uses: googleapis/release-please-action@v4
|
13
17
|
id: release
|
14
18
|
with:
|
15
|
-
|
16
|
-
default-branch: master
|
17
|
-
release-type: ruby
|
18
|
-
package-name: bsb
|
19
|
-
version-file: lib/bsb/version.rb
|
20
|
-
fork: false
|
21
|
-
bump-minor-pre-major: true
|
22
|
-
bump-patch-for-minor-pre-major: true
|
23
|
-
|
24
|
-
- if: ${{ steps.release.outputs.release_created }}
|
25
|
-
uses: actions/checkout@v4
|
26
|
-
|
27
|
-
- if: ${{ steps.release.outputs.release_created }}
|
28
|
-
name: Set up Ruby
|
29
|
-
uses: ruby/setup-ruby@v1
|
30
|
-
with:
|
31
|
-
bundler-cache: true
|
32
|
-
|
33
|
-
- if: ${{ steps.release.outputs.release_created }}
|
34
|
-
name: Publish to GPR
|
35
|
-
run: |
|
36
|
-
mkdir -p $HOME/.gem
|
37
|
-
touch $HOME/.gem/credentials
|
38
|
-
chmod 0600 $HOME/.gem/credentials
|
39
|
-
printf -- "---\n:github: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
40
|
-
gem build *.gemspec
|
41
|
-
gem push --KEY github --host https://rubygems.pkg.github.com/${OWNER} *.gem
|
42
|
-
env:
|
43
|
-
GEM_HOST_API_KEY: "Bearer ${{secrets.GITHUB_TOKEN}}"
|
44
|
-
OWNER: ${{ github.repository_owner }}
|
45
|
-
|
46
|
-
- if: ${{ steps.release.outputs.release_created }}
|
47
|
-
name: Publish to RubyGems
|
48
|
-
run: |
|
49
|
-
mkdir -p $HOME/.gem
|
50
|
-
touch $HOME/.gem/credentials
|
51
|
-
chmod 0600 $HOME/.gem/credentials
|
52
|
-
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
53
|
-
gem build *.gemspec
|
54
|
-
gem push *.gem
|
55
|
-
env:
|
56
|
-
GEM_HOST_API_KEY: "${{secrets.RUBYGEMS_API_KEY}}"
|
19
|
+
target-branch: master
|
@@ -0,0 +1,38 @@
|
|
1
|
+
name: Update BSB DB
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
schedule:
|
6
|
+
- cron: "0 15 1,8,15,22,29 * *" # “At 15:00 on day-of-month 1, 8, 15, 22, and 29.”
|
7
|
+
|
8
|
+
jobs:
|
9
|
+
update-bsb:
|
10
|
+
runs-on: ubuntu-latest
|
11
|
+
env:
|
12
|
+
AUSPAYNET_SUB_KEY: ${{secrets.AUSPAYNET_SUB_KEY}}
|
13
|
+
steps:
|
14
|
+
- name: Checkout
|
15
|
+
uses: actions/checkout@v4
|
16
|
+
|
17
|
+
- name: Setup Ruby
|
18
|
+
uses: ruby/setup-ruby@v1
|
19
|
+
with:
|
20
|
+
bundler-cache: true
|
21
|
+
|
22
|
+
- name: Fetch latest contents
|
23
|
+
run: bundle exec rake bsb:sync_bsb_db
|
24
|
+
|
25
|
+
- name: Remove latest_update file
|
26
|
+
run: rm -f config/latest_update.json
|
27
|
+
|
28
|
+
- name: Create Pull Request
|
29
|
+
uses: peter-evans/create-pull-request@v7
|
30
|
+
with:
|
31
|
+
branch: update-bsb-db
|
32
|
+
title: "fix: Update BSB Database"
|
33
|
+
body: |
|
34
|
+
This Pull Request was created via a Github Action.
|
35
|
+
|
36
|
+
The related workflow file is `.github/workflows/update_bsb_db.yml` and the changes are generated using the rake task `bsb:sync_bsb_db`
|
37
|
+
|
38
|
+
If you're unsure how to proceed with this PR, please see the [README](https://github.com/coinjar/bsb/blob/master/README.md#update-bsb-db)
|
@@ -1 +1 @@
|
|
1
|
-
{".":"1.2.
|
1
|
+
{".":"1.2.6"}
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,27 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [1.2.6](https://github.com/coinjar/bsb/compare/v1.2.5...v1.2.6) (2024-10-23)
|
4
|
+
|
5
|
+
|
6
|
+
### Bug Fixes
|
7
|
+
|
8
|
+
* move publish action file location ([#71](https://github.com/coinjar/bsb/issues/71)) ([35d4985](https://github.com/coinjar/bsb/commit/35d49858bd983e52ff61b73ff113de0e9deaf1b1))
|
9
|
+
|
10
|
+
## [1.2.5](https://github.com/coinjar/bsb/compare/v1.2.4...v1.2.5) (2024-10-22)
|
11
|
+
|
12
|
+
|
13
|
+
### Bug Fixes
|
14
|
+
|
15
|
+
* separate release and publish actions ([#68](https://github.com/coinjar/bsb/issues/68)) ([65597c0](https://github.com/coinjar/bsb/commit/65597c0dbee43b4515f48297fdf435072ff3768a))
|
16
|
+
* Update BSB Database ([#70](https://github.com/coinjar/bsb/issues/70)) ([8f26926](https://github.com/coinjar/bsb/commit/8f2692676681f1c2f8aeba3c9ea188afb95359fc))
|
17
|
+
|
18
|
+
## [1.2.4](https://github.com/coinjar/bsb/compare/v1.2.3...v1.2.4) (2024-10-20)
|
19
|
+
|
20
|
+
|
21
|
+
### Bug Fixes
|
22
|
+
|
23
|
+
* upgrade release please ([#66](https://github.com/coinjar/bsb/issues/66)) ([4b04ef6](https://github.com/coinjar/bsb/commit/4b04ef638f763c48affc6e61ead0249b2d69085f))
|
24
|
+
|
3
25
|
## [1.2.3](https://github.com/coinjar/bsb/compare/v1.2.2...v1.2.3) (2024-10-01)
|
4
26
|
|
5
27
|
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -68,18 +68,53 @@ Two data sources are used:
|
|
68
68
|
|
69
69
|
Other formats of APCA BSB data is available from http://bsb.apca.com.au.
|
70
70
|
|
71
|
-
## Update
|
71
|
+
## Update BSB Bank List
|
72
72
|
|
73
73
|
At the moment BSB data is a manual download from the Auspaynet site [here](https://bsb.auspaynet.com.au/).
|
74
74
|
|
75
|
-
You will need to download
|
75
|
+
You will need to download the Key to Abbreviations and BSB Number file and place it in `tmp/`:
|
76
76
|
- `Reference Documents` button > `Key to Abbreviations and BSB Number` in CSV format.
|
77
|
+
|
78
|
+
Run the sync task with the files to complete sync of the latest data:
|
79
|
+
|
80
|
+
```sh
|
81
|
+
rake bsb:sync_bank_list['tmp/key to abbreviations and bsb numbers (august 2024).csv']
|
82
|
+
```
|
83
|
+
|
84
|
+
Browse the list of database changes, make a few queries on the website to ensure the results are the same.
|
85
|
+
|
86
|
+
## Update BSB DB
|
87
|
+
|
88
|
+
`config/bsb_db.json` can be updated by running the `bsb:sync_bsb_db` rake task.
|
89
|
+
This task depends on you having you having an Aus Pay Net API subscription and key and that key being available in the
|
90
|
+
`AUSPAYNET_SUB_KEY` environment variable.
|
91
|
+
|
92
|
+
You can apply for an API subscription and key by visiting [AusPayNet's bsb page](https://bsb.auspaynet.com.au/),
|
93
|
+
clicking the `API Registration` button and following the prompts.
|
94
|
+
|
95
|
+
Once you have a key, the task can be run as follows
|
96
|
+
|
97
|
+
```sh
|
98
|
+
AUSPAYNET_SUB_KEY="your_key_here" rake bsb:sync_bsb_db
|
99
|
+
```
|
100
|
+
|
101
|
+
This will update the `config/bsb_db.json` file with the latest information and will produce a
|
102
|
+
`config/latest_update.json` file that contains a breakdown of additions, deletions and modifications to make spot
|
103
|
+
checking results easier.
|
104
|
+
|
105
|
+
Browse the list of database changes, make a few queries on the website to ensure the results are the same.
|
106
|
+
|
107
|
+
## Update BSB DB (Manual)
|
108
|
+
|
109
|
+
BSB DB data can be downloaded manually from the Auspaynet site [here](https://bsb.auspaynet.com.au/).
|
110
|
+
|
111
|
+
You will need to download the BSB directory and place it in `tmp/`:
|
77
112
|
- `Download BSB Files` button > `BSB Directory (Full Version)` in TEXT format.
|
78
113
|
|
79
114
|
Run the sync task with the files to complete sync of the latest data:
|
80
115
|
|
81
116
|
```sh
|
82
|
-
rake bsb:
|
117
|
+
rake bsb:sync_bsb_db_manual['tmp/BSBDirectoryAug24-341.txt']
|
83
118
|
```
|
84
119
|
|
85
120
|
Browse the list of database changes, make a few queries on the website to ensure the results are the same.
|