Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
Merge pull request #84 from carolynvs/gh-releases
Browse files Browse the repository at this point in the history
Publish to GH
  • Loading branch information
carolynvs authored Apr 8, 2021
2 parents 9fa978e + 6c5b3e1 commit 02defaa
Show file tree
Hide file tree
Showing 7 changed files with 216 additions and 74 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/bin
/helm
*-packr.go

/build/git_askpass.sh
.vscode/launch.json
14 changes: 1 addition & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -75,19 +75,7 @@ test-integration: xbuild
$(GO) test -tags=integration ./tests/...

publish: bin/porter$(FILE_EXT)
# AZURE_STORAGE_CONNECTION_STRING will be used for auth in the following commands
if [[ "$(PERMALINK)" == "latest" ]]; then \
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(VERSION) -s $(BINDIR)/$(VERSION); \
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(PERMALINK) -s $(BINDIR)/$(VERSION); \
else \
mv $(BINDIR)/$(VERSION) $(BINDIR)/$(PERMALINK); \
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(PERMALINK) -s $(BINDIR)/$(PERMALINK); \
fi

# Generate the mixin feed
az storage blob download -c porter -n atom.xml -f bin/atom.xml
bin/porter mixins feed generate -d bin/mixins -f bin/atom.xml -t build/atom-template.xml
az storage blob upload -c porter -n atom.xml -f bin/atom.xml
go run mage.go Publish $(MIXIN) $(VERSION) $(PERMALINK)

bin/porter$(FILE_EXT):
curl -fsSLo bin/porter$(FILE_EXT) https://cdn.porter.sh/canary/porter-$(CLIENT_PLATFORM)-$(CLIENT_ARCH)$(FILE_EXT)
Expand Down
6 changes: 4 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ trigger:
branches:
include:
- refs/heads/main
- refs/tags/*
- refs/tags/v*

pool:
vmImage: 'Ubuntu 16.04'
Expand Down Expand Up @@ -38,6 +38,8 @@ steps:
displayName: 'Integration Test'

- script: |
AZURE_STORAGE_CONNECTION_STRING=$(AZURE_STORAGE_CONNECTION_STRING) make publish
make publish
env:
GITHUB_TOKEN: $(GITHUB_TOKEN)
displayName: 'Publish'
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))
15 changes: 6 additions & 9 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,16 @@ module get.porter.sh/mixin/helm
go 1.13

require (
get.porter.sh/porter v0.25.0-beta.1
get.porter.sh/porter v0.37.2
github.com/Masterminds/semver v1.5.0
github.com/dsnet/compress v0.0.1 // indirect
github.com/ghodss/yaml v1.0.0
github.com/gobuffalo/packr/v2 v2.7.1
github.com/hashicorp/go-multierror v1.0.0
github.com/gobuffalo/packr/v2 v2.8.0
github.com/hashicorp/go-multierror v1.1.0
github.com/mholt/archiver v3.1.1+incompatible
github.com/nwaples/rardecode v1.0.0 // indirect
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
github.com/stretchr/testify v1.4.0
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v1.0.0
github.com/stretchr/testify v1.6.1
github.com/xeipuuv/gojsonschema v1.2.0
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
gopkg.in/yaml.v2 v2.2.4
k8s.io/apimachinery v0.0.0-20191004115801-a2eda9f80ab8
k8s.io/client-go v0.0.0-20191016111102-bec269661e48
Expand Down
222 changes: 173 additions & 49 deletions go.sum

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions mage.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// +build ignore

package main

import (
"os"

"github.com/magefile/mage/mage"
)

// This file allows someone to run mage commands without mage installed
// by running `go run mage.go TARGET`.
// See https://magefile.org/zeroinstall/
func main() { os.Exit(mage.Main()) }
17 changes: 17 additions & 0 deletions magefile.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// +build mage

package main

import (
// mage:import
"get.porter.sh/porter/mage/releases"
)

// We are migrating to mage, but for now keep using make as the main build script interface.

// Publish the cross-compiled binaries.
func Publish(mixin string, version string, permalink string) {
releases.PrepareMixinForPublish(mixin, version, permalink)
releases.PublishMixin(mixin, version, permalink)
releases.PublishMixinFeed(mixin, version)
}

0 comments on commit 02defaa

Please sign in to comment.