Skip to content

Commit

Permalink
Merge pull request #252 from kaleido-io/fix-query-installed-cc
Browse files Browse the repository at this point in the history
Fix checking result of queryInstalled()
  • Loading branch information
nguyer committed Aug 18, 2023
2 parents 6246b18 + 13d6d3c commit 0829455
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Expand Up @@ -5,7 +5,7 @@ on:
branches:
- main
tags:
- 'v*'
- "v*"
pull_request:

permissions:
Expand All @@ -15,22 +15,19 @@ jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.18
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19 changes: 11 additions & 8 deletions .goreleaser.yml
Expand Up @@ -28,19 +28,22 @@ builds:
ldflags:
- "-s -w -X 'github.com/hyperledger/firefly-cli/cmd.BuildVersionOverride={{.Version}}' -X 'github.com/hyperledger/firefly-cli/cmd.BuildDate={{.Date}}' -X 'github.com/hyperledger/firefly-cli/cmd.BuildCommit={{.Commit}}'"
archives:
- replacements:
darwin: macOS
linux: Linux
amd64: x86_64
- name_template: >-
{{ .ProjectName }}_{{ .Version }}_
{{- if eq .Os "darwin" }}macOS
{{- else if eq .Os "linux" }}Linux
{{- else }}{{ .Os }}{{ end }}_
{{- if eq .Arch "amd64" }}x86_64
{{- else }}{{ .Arch }}{{ end }}
checksum:
name_template: 'checksums.txt'
name_template: "checksums.txt"
snapshot:
name_template: "{{ incpatch .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'
- "^docs:"
- "^test:"
release:
prerelease: auto
prerelease: auto
5 changes: 4 additions & 1 deletion internal/blockchain/fabric/fabric_provider.go
Expand Up @@ -26,6 +26,7 @@ import (
"os"
"path"
"path/filepath"
"regexp"

"github.com/hyperledger/firefly-cli/internal/blockchain/fabric/fabconnect"
"github.com/hyperledger/firefly-cli/internal/docker"
Expand Down Expand Up @@ -543,7 +544,9 @@ func (p *FabricProvider) DeployContract(filename, contractName, instanceName str
chaincodeInstalled := false
packageID := ""
for _, installedChaincode := range res.InstalledChaincodes {
if installedChaincode.Label == chaincode {
validLabel := regexp.MustCompile(`^([^_]+)_.+$`)
matches := validLabel.FindStringSubmatch(installedChaincode.Label)
if len(matches) > 0 && matches[1] == chaincode {
chaincodeInstalled = true
packageID = installedChaincode.PackageID
break
Expand Down

0 comments on commit 0829455

Please sign in to comment.