Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix checking result of queryInstalled() #252

Merged
merged 6 commits into from
Aug 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading