Skip to content

Commit

Permalink
Introduce Go Modules to tooling (#1901)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaomidi authored Nov 27, 2023
1 parent ae46e51 commit 2d1427a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
go-version: 'stable'

- name: Run Go unit tests
run: go test tools/*.go
run: go test -C ./tools .

- name: Install dependencies
run: sudo apt install -y autopoint
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tld-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
schedule:
# Run once a day at 15:00 UTC
- cron: '0 15 * * *'

permissions:
contents: read

Expand All @@ -26,7 +26,7 @@ jobs:
go-version: 'stable'

- name: Run unit tests
run: go test tools/*.go
run: go test -v -C ./tools .

- name: Set current date
id: get-date
Expand All @@ -49,7 +49,7 @@ jobs:
✅ autopull
🚩ICANN (IANA/ICP-3) Section
delete-branch: true

- name: Check outputs
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
Expand Down
3 changes: 3 additions & 0 deletions tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module github.com/publicsuffix/list/tools

go 1.21
6 changes: 4 additions & 2 deletions tools/patchnewgtlds
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@

set -e
set -o pipefail
set -x

if ! [ -x "$(command -v go)" ]
then
echo "error: a go binary in \$PATH is required to run newgtlds.go" >&2
exit 1
fi

BASEDIR=$(dirname "$0")
SCRIPT=$(realpath "$0")
BASEDIR=$(dirname "$SCRIPT")

go run "$BASEDIR/newgtlds.go" \
go run -C "$BASEDIR/" . \
-overwrite \
-psl-dat-file="$BASEDIR/../public_suffix_list.dat"

0 comments on commit 2d1427a

Please sign in to comment.