From 38f43ec0e09120fdf73e352bb883cfa21f724aaf Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Sat, 8 Jun 2024 19:39:37 +0200 Subject: [PATCH 1/4] Make toolchain match Porter core Signed-off-by: Kim Christensen --- go.mod | 2 ++ 1 file changed, 2 insertions(+) diff --git a/go.mod b/go.mod index 7270e9c..d9bdd8a 100644 --- a/go.mod +++ b/go.mod @@ -2,6 +2,8 @@ module get.porter.sh/mixin/az go 1.21 +toolchain go1.21.3 + // These are replace directives copied from porter // When you use a newer version of Porter, if you run into trouble with go mod tidy // Copy any additional replace directives from Porter's go.mod file From 4016aae7ec3435619044b843791b24557a7b93e3 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Sat, 8 Jun 2024 19:40:13 +0200 Subject: [PATCH 2/4] Add mage target SetupDCO Signed-off-by: Kim Christensen --- magefile.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/magefile.go b/magefile.go index f053317..8cf23e2 100644 --- a/magefile.go +++ b/magefile.go @@ -3,6 +3,7 @@ package main import ( + "get.porter.sh/magefiles/git" "get.porter.sh/magefiles/mixins" ) @@ -57,3 +58,9 @@ func Install() { func Clean() { magefile.Clean() } + +// SetupDCO configures your git repository to automatically sign your commits +// to comply with our DCO +func SetupDCO() error { + return git.SetupDCO() +} From dd50afd3de2eea420b16f8be9ee2695fdbfd2efe Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Sat, 8 Jun 2024 19:40:54 +0200 Subject: [PATCH 3/4] Convert to Github Actions Signed-off-by: Kim Christensen --- .github/workflows/az-mixin.yml | 30 ++++++++++++++++++++++++++++++ azure-pipelines.yml | 34 ---------------------------------- 2 files changed, 30 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/az-mixin.yml delete mode 100644 azure-pipelines.yml diff --git a/.github/workflows/az-mixin.yml b/.github/workflows/az-mixin.yml new file mode 100644 index 0000000..aa5dcff --- /dev/null +++ b/.github/workflows/az-mixin.yml @@ -0,0 +1,30 @@ +name: porter/az-mixin +on: + push: + branches: + - main + - v* + pull_request: + branches: + - main +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 + with: + go-version-file: go.mod + cache: true + - name: Configure Agent + run: go run mage.go ConfigureAgent + - name: Test + run: mage Test + - name: Cross Compile + run: mage XBuildAll + - name: Publish + if: success() && github.event_name != 'PullRequest' + env: + GITHUB_TOKEN: "${{ secrets.PUBLISH_TOKEN }}" + run: mage Publish \ No newline at end of file diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index ea845ca..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,34 +0,0 @@ -# Go -# Build your Go project. -# Add steps that test, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/go - -trigger: - branches: - include: - - refs/heads/main - - refs/tags/v* - -pool: - vmImage: 'ubuntu-latest' - -steps: -- task: GoTool@0 - inputs: - version: '1.19.2' - displayName: 'Install Go' - -- script: go run mage.go ConfigureAgent - displayName: "Configure Agent" - -- script: mage Test - displayName: 'Test' - -- script: mage XBuildAll - displayName: 'Cross Compile' - -- script: mage Publish - env: - GITHUB_TOKEN: $(GITHUB_TOKEN) - displayName: 'Publish' - condition: and(succeeded(), ne(variables['Build.Reason'], 'PullRequest')) From d25e7e4a8f15e4a5f18427b536f595624b347675 Mon Sep 17 00:00:00 2001 From: Kim Christensen Date: Sat, 8 Jun 2024 19:41:37 +0200 Subject: [PATCH 4/4] Update magefile and porter dependencies Signed-off-by: Kim Christensen --- go.mod | 3 ++- go.sum | 8 ++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/go.mod b/go.mod index d9bdd8a..51b5536 100644 --- a/go.mod +++ b/go.mod @@ -12,7 +12,7 @@ toolchain go1.21.3 replace github.com/spf13/viper => github.com/getporter/viper v1.7.1-porter.2.0.20210514172839-3ea827168363 require ( - get.porter.sh/magefiles v0.6.3 + get.porter.sh/magefiles v0.6.7 get.porter.sh/porter v1.0.17 github.com/PaesslerAG/jsonpath v0.1.1 github.com/ghodss/yaml v1.0.0 @@ -100,6 +100,7 @@ require ( github.com/qri-io/jsonpointer v0.1.1 // indirect github.com/qri-io/jsonschema v0.2.2-0.20210831022256-780655b2ba0e // indirect github.com/rivo/uniseg v0.4.4 // indirect + github.com/sergi/go-diff v1.2.0 // indirect github.com/shopspring/decimal v1.3.1 // indirect github.com/sirupsen/logrus v1.9.3 // indirect github.com/spf13/afero v1.9.5 // indirect diff --git a/go.sum b/go.sum index dff4f48..4f1f8cb 100644 --- a/go.sum +++ b/go.sum @@ -37,8 +37,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= -get.porter.sh/magefiles v0.6.3 h1:OE9YqCArn9fvM+VdanGlXNyIjy2F8W4yJGy5kcC/xD0= -get.porter.sh/magefiles v0.6.3/go.mod h1:w37oTKICvvaEKR5KVB9UfN2EX30uYO9Qk0oRoz80DOU= +get.porter.sh/magefiles v0.6.7 h1:/MtnsUs17yRRSZyh6IRX+eP4dc47IRGwUY0aMgUK06Y= +get.porter.sh/magefiles v0.6.7/go.mod h1:w37oTKICvvaEKR5KVB9UfN2EX30uYO9Qk0oRoz80DOU= get.porter.sh/porter v1.0.17 h1:x827yJ4VUsYLL8glC8GUZq+gycme1gYtvu/viyH1S+g= get.porter.sh/porter v1.0.17/go.mod h1:NtSW1T0UhrnwGBf0H5nhgTkHMnt97j338w+XtjQoDCU= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= @@ -552,8 +552,8 @@ github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E= github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= -github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/sergi/go-diff v1.2.0 h1:XU+rvMAioB0UC3q1MFrIQy4Vo5/4VsRDQQXHsEya6xQ= +github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc=