Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

ci: uci/copy-templates #2

Closed
wants to merge 10 commits into from
18 changes: 18 additions & 0 deletions .github/workflows/go-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Go Checks

on:
pull_request:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

jobs:
go-check:
uses: pl-strflt/uci/.github/workflows/[email protected]
18 changes: 18 additions & 0 deletions .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Go Test

on:
pull_request:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
cancel-in-progress: true

jobs:
go-test:
uses: pl-strflt/uci/.github/workflows/[email protected]
19 changes: 19 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Release Checker

on:
pull_request_target:
paths: [ 'version.json' ]
types: [ opened, synchronize, reopened, labeled, unlabeled ]
workflow_dispatch:

permissions:
contents: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
release-check:
uses: pl-strflt/uci/.github/workflows/[email protected]
17 changes: 17 additions & 0 deletions .github/workflows/releaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Releaser

on:
push:
paths: [ 'version.json' ]
workflow_dispatch:

permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.sha }}
cancel-in-progress: true

jobs:
releaser:
uses: pl-strflt/uci/.github/workflows/[email protected]
18 changes: 18 additions & 0 deletions .github/workflows/tagpush.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Tag Push Checker

on:
push:
tags:
- v*

permissions:
contents: read
issues: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
releaser:
uses: pl-strflt/uci/.github/workflows/[email protected]
3 changes: 3 additions & 0 deletions cmd/stargate/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ var fetchCmd = &cli.Command{
return err
}
ro, err := blockstore.OpenReadOnly(name)
if err != nil {
return err
}

ls := cidlink.DefaultLinkSystem()
ls.TrustedStorage = true
Expand Down
12 changes: 6 additions & 6 deletions cmd/stargate/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ var importCmd = &cli.Command{
}
newLocale := filepath.Join(carPath(repoDir), root.String()+".car")
if fileExists(newLocale) {
return errors.New("File or directory already imported")
return errors.New("file or directory already imported")
}
err = os.Rename(carFileName, newLocale)
if err != nil {
return fmt.Errorf("Renaming file: %w", err)
return fmt.Errorf("renaming file: %w", err)
}
carFileName = newLocale

Expand Down Expand Up @@ -128,23 +128,23 @@ func indexImport(ctx context.Context, carFileName string, db *sql.SQLUnixFSStore

bs, err := stores.ReadOnlyFilestore(carFileName)
if err != nil {
return fmt.Errorf("Reopening file store")
return fmt.Errorf("reopening file store")
}
allKeys, err := bs.AllKeysChan(ctx)
if err != nil {
return fmt.Errorf("Fetching all block keys")
return fmt.Errorf("fetching all block keys")
}
lsys := storeutil.LinkSystemForBlockstore(bs)

roots, err := traversal.DiscoverRoots(ctx, allKeys, &lsys)
if err != nil {
return fmt.Errorf("Discovering roots: %w", err)
return fmt.Errorf("discovering roots: %w", err)
}

for _, root := range roots {
err := db.AddRoot(ctx, root, []byte(carFileName), &lsys)
if err != nil {
return fmt.Errorf("Adding root to index: %w", err)
return fmt.Errorf("adding root to index: %w", err)
}
}
return bs.Close()
Expand Down
52 changes: 31 additions & 21 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
module github.com/ipfs/stargate

go 1.19
go 1.20

require (
github.com/fatih/color v1.7.0
github.com/ipfs/go-block-format v0.0.3
github.com/ipfs/go-blockservice v0.5.0
github.com/ipfs/go-cid v0.3.2
github.com/ipfs/go-cid v0.4.1
github.com/ipfs/go-cidutil v0.1.0
github.com/ipfs/go-datastore v0.6.0
github.com/ipfs/go-ipfs-blockstore v1.2.0
Expand All @@ -25,24 +25,26 @@ require (
github.com/jbenet/go-random v0.0.0-20190219211222-123a90aedc0c
github.com/jbenet/goprocess v0.1.4
github.com/mitchellh/go-homedir v1.1.0
github.com/multiformats/go-multicodec v0.6.0
github.com/multiformats/go-multicodec v0.9.0
github.com/petar/GoLLRB v0.0.0-20210522233825-ae3b015fd3e9
github.com/stretchr/testify v1.8.1
github.com/stretchr/testify v1.8.4
github.com/urfave/cli/v2 v2.16.3
github.com/whyrusleeping/cbor v0.0.0-20171005072247-63513f603b11
go.uber.org/multierr v1.8.0
golang.org/x/exp v0.0.0-20220916125017-b168a2c6b86b
go.uber.org/multierr v1.11.0
golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2
)

require (
github.com/alecthomas/units v0.0.0-20210927113745-59d0afb8317a // indirect
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.2 // indirect
github.com/crackcomm/go-gitignore v0.0.0-20170627025303-887ab5e44cc3 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/go-logr/logr v1.2.3 // indirect
github.com/go-logr/logr v1.2.4 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/google/pprof v0.0.0-20230821062121-407c9e7a662f // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/ipfs/bbloom v0.0.4 // indirect
Expand All @@ -55,25 +57,33 @@ require (
github.com/ipfs/go-log v1.0.5 // indirect
github.com/ipfs/go-metrics-interface v0.0.1 // indirect
github.com/ipfs/go-verifcid v0.0.2 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-libp2p v0.30.0 // indirect
github.com/mattn/go-colorable v0.1.1 // indirect
github.com/mattn/go-isatty v0.0.17 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/multiformats/go-multiaddr v0.11.0 // indirect
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/polydawn/refmt v0.0.0-20201211092308-30ac6d18308e // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/common v0.44.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/quic-go/quic-go v0.38.0 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/spaolacci/murmur3 v1.1.0 // indirect
github.com/whyrusleeping/cbor-gen v0.0.0-20221220214510-0333c149dec0 // indirect
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
go.opentelemetry.io/otel v1.7.0 // indirect
go.opentelemetry.io/otel/trace v1.7.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
go.uber.org/zap v1.23.0 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
google.golang.org/protobuf v1.28.1 // indirect
go.uber.org/atomic v1.11.0 // indirect
go.uber.org/zap v1.25.0 // indirect
golang.org/x/sync v0.3.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.1.7 // indirect
lukechampine.com/blake3 v1.2.1 // indirect
)

require (
Expand All @@ -82,15 +92,15 @@ require (
github.com/ipfs/go-filestore v1.2.0
github.com/ipfs/go-unixfsnode v1.5.0
github.com/ipld/go-ipld-prime v0.19.0
github.com/klauspost/cpuid/v2 v2.1.2 // indirect
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
github.com/mattn/go-sqlite3 v1.14.16
github.com/minio/sha256-simd v1.0.0 // indirect
github.com/minio/sha256-simd v1.0.1 // indirect
github.com/mr-tron/base58 v1.2.0 // indirect
github.com/multiformats/go-base32 v0.1.0 // indirect
github.com/multiformats/go-base36 v0.1.0 // indirect
github.com/multiformats/go-multibase v0.1.1 // indirect
github.com/multiformats/go-multihash v0.2.1
github.com/multiformats/go-base36 v0.2.0 // indirect
github.com/multiformats/go-multibase v0.2.0 // indirect
github.com/multiformats/go-multihash v0.2.3
github.com/multiformats/go-varint v0.0.7
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab // indirect
golang.org/x/crypto v0.12.0 // indirect
golang.org/x/sys v0.11.0 // indirect
)
Loading
Loading