Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
firefart committed Aug 16, 2023
1 parent 2f4801b commit fbfab63
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 13 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Build Docker Images

on:
push:
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 0 * * *"

jobs:
Dockerhub:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: checkout sources
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push
uses: docker/build-push-action@v4
with:
push: true
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
tags: |
ghcr.io/firefart/hijagger:latest
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/firefart/hijagger

go 1.19
go 1.21

require (
github.com/jpillora/go-tld v1.2.1
Expand Down
10 changes: 0 additions & 10 deletions helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,3 @@ func getRootDomain(domain string) (string, error) {
rootDomain := fmt.Sprintf("%s.%s", u.Domain, u.TLD)
return rootDomain, nil
}

func keysFromMap[V any](m map[string]V) []string {
ret := make([]string, len(m))
i := 0
for k := range m {
ret[i] = k
i += 1
}
return ret
}
4 changes: 3 additions & 1 deletion npm.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import (
"fmt"
"net/mail"
"os"

"golang.org/x/exp/maps"
)

type npmAll struct {
Expand Down Expand Up @@ -68,7 +70,7 @@ func (a *app) npmGetPackageMaintainer(name string) ([]string, error) {
}
}

return keysFromMap(maintainers), nil
return maps.Keys(maintainers), nil
}

func (a *app) npmGetAllPackageNames(local string) ([]string, error) {
Expand Down
4 changes: 3 additions & 1 deletion pypi.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"net/mail"
"regexp"
"strings"

"golang.org/x/exp/maps"
)

func (a *app) pypiGetAllPackageNames(local string) ([]string, error) {
Expand Down Expand Up @@ -66,7 +68,7 @@ func (a *app) pypiGetPackageMaintainer(name string) ([]string, error) {
}
}

return keysFromMap(maintainers), nil
return maps.Keys(maintainers), nil
}

func getPypiLink(name string) string {
Expand Down

0 comments on commit fbfab63

Please sign in to comment.