Skip to content

Commit 38b393c

Browse files
committed
Publish to GH
Signed-off-by: Carolyn Van Slyck <[email protected]>
1 parent ab0f73c commit 38b393c

8 files changed

+517
-24
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/bin
22
/azure
33
*-packr.go
4+
/build/git_askpass.sh

Makefile

+1-13
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,7 @@ ifndef HAS_JSONPP
7575
endif
7676

7777
publish: bin/porter$(FILE_EXT)
78-
# AZURE_STORAGE_CONNECTION_STRING will be used for auth in the following commands
79-
if [[ "$(PERMALINK)" == "latest" ]]; then \
80-
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(VERSION) -s $(BINDIR)/$(VERSION); \
81-
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(PERMALINK) -s $(BINDIR)/$(VERSION); \
82-
else \
83-
mv $(BINDIR)/$(VERSION) $(BINDIR)/$(PERMALINK); \
84-
az storage blob upload-batch -d porter/mixins/$(MIXIN)/$(PERMALINK) -s $(BINDIR)/$(PERMALINK); \
85-
fi
86-
87-
# Generate the mixin feed
88-
az storage blob download -c porter -n atom.xml -f bin/atom.xml
89-
bin/porter mixins feed generate -d bin/mixins -f bin/atom.xml -t build/atom-template.xml
90-
az storage blob upload -c porter -n atom.xml -f bin/atom.xml
78+
go run mage.go Publish $(MIXIN) $(VERSION) $(PERMALINK)
9179

9280
bin/porter$(FILE_EXT):
9381
curl -fsSLo bin/porter$(FILE_EXT) https://cdn.porter.sh/canary/porter-$(CLIENT_PLATFORM)-$(CLIENT_ARCH)$(FILE_EXT)

azure-pipelines.yml

+4-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ trigger:
77
branches:
88
include:
99
- refs/heads/main
10-
- refs/tags/*
10+
- refs/tags/v*
1111

1212
pool:
1313
vmImage: 'Ubuntu 16.04'
@@ -26,16 +26,15 @@ steps:
2626

2727
- script: |
2828
make build test
29-
workingDirectory: '$(System.DefaultWorkingDirectory)'
3029
displayName: 'Unit Test'
3130

3231
- script: |
3332
make xbuild-all
34-
workingDirectory: '$(System.DefaultWorkingDirectory)'
3533
displayName: 'Cross Compile'
3634

3735
- script: |
38-
AZURE_STORAGE_CONNECTION_STRING=$(AZURE_STORAGE_CONNECTION_STRING) make publish
39-
workingDirectory: '$(System.DefaultWorkingDirectory)'
36+
make publish
37+
env:
38+
GITHUB_TOKEN: $(GITHUB_TOKEN)
4039
displayName: 'Publish'
4140
condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest'))

go.mod

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module get.porter.sh/mixin/arm
33
go 1.13
44

55
require (
6-
get.porter.sh/porter v0.22.1-beta.1
6+
get.porter.sh/porter v0.37.2
77
github.com/Azure/azure-sdk-for-go v38.2.0+incompatible
88
github.com/Azure/go-autorest v12.2.0+incompatible
99
github.com/Azure/go-autorest/autorest v0.9.0
@@ -12,13 +12,14 @@ require (
1212
github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
1313
github.com/Masterminds/goutils v1.1.0 // indirect
1414
github.com/Masterminds/sprig v2.22.0+incompatible
15-
github.com/gobuffalo/packr/v2 v2.7.1
15+
github.com/gobuffalo/envy v1.7.1 // indirect
16+
github.com/gobuffalo/packr/v2 v2.8.0
1617
github.com/huandu/xstrings v1.3.0 // indirect
1718
github.com/kelseyhightower/envconfig v1.4.0
1819
github.com/mitchellh/copystructure v1.0.0 // indirect
19-
github.com/pkg/errors v0.8.1
20-
github.com/spf13/cobra v0.0.5
21-
github.com/stretchr/testify v1.4.0
20+
github.com/pkg/errors v0.9.1
21+
github.com/spf13/cobra v1.0.0
22+
github.com/stretchr/testify v1.6.1
2223
gopkg.in/yaml.v2 v2.2.4
2324
)
2425

go.sum

+472
Large diffs are not rendered by default.

mage.go

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// +build ignore
2+
3+
package main
4+
5+
import (
6+
"os"
7+
8+
"github.com/magefile/mage/mage"
9+
)
10+
11+
// This file allows someone to run mage commands without mage installed
12+
// by running `go run mage.go TARGET`.
13+
// See https://magefile.org/zeroinstall/
14+
func main() { os.Exit(mage.Main()) }

magefile.go

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// +build mage
2+
3+
package main
4+
5+
import (
6+
// mage:import
7+
"get.porter.sh/porter/mage/releases"
8+
)
9+
10+
// We are migrating to mage, but for now keep using make as the main build script interface.
11+
12+
// Publish the cross-compiled binaries.
13+
func Publish(mixin string, version string, permalink string) {
14+
releases.PrepareMixinForPublish(mixin, version, permalink)
15+
releases.PublishMixin(mixin, version, permalink)
16+
releases.PublishMixinFeed(mixin, version)
17+
}

pkg/arm/version.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package arm
33
import (
44
"get.porter.sh/mixin/arm/pkg"
55
"get.porter.sh/porter/pkg/mixin"
6+
"get.porter.sh/porter/pkg/pkgmgmt"
67
"get.porter.sh/porter/pkg/porter/version"
78
)
89

910
func (m *Mixin) PrintVersion(opts version.Options) error {
1011
metadata := mixin.Metadata{
1112
Name: "arm",
12-
VersionInfo: mixin.VersionInfo{
13+
VersionInfo: pkgmgmt.VersionInfo{
1314
Version: pkg.Version,
1415
Commit: pkg.Commit,
1516
Author: "Porter Authors",

0 commit comments

Comments
 (0)