From b8de027af29d110ebfb5752d7af9f1ae8d1c03be Mon Sep 17 00:00:00 2001 From: Christopher Braun Date: Thu, 7 Nov 2024 16:01:31 +0100 Subject: [PATCH 1/2] Feature/GitHub Actions (#1) * Changed plugin version to *.*.* format * Added Build and Release steps. * Fixed naming of workflow file. * Adjusted deprecated action. * Adjusted release action to only run on tags. * Adjusted release action to only run on tags. * Adjusted release action to only run on tags. * Separated workflows. * Separated workflows. * Refactored build * Updated action versions. * reverted to combined workflow. * reverted to build workflow. --- .github/workflows/build.yml | 32 ++++++++++++++++++++++++++++++++ go-jwt-kc.plugin.go | 2 +- 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..94e8988 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,32 @@ +name: Build-and-Release + +on: [ push ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + goos: [ linux ] + goarch: [ amd64, arm64 ] + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Build + run: | + mkdir -p dist + GOOS=${{ matrix.goos }} GOARCH=${{ matrix.goarch }} go build -o dist/go-jwt-kc-${{ matrix.goos }}-${{ matrix.goarch }} + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: go-jwt-kc-${{ matrix.goos }}-${{ matrix.goarch }} + path: dist/ \ No newline at end of file diff --git a/go-jwt-kc.plugin.go b/go-jwt-kc.plugin.go index 27cd4dd..8822988 100644 --- a/go-jwt-kc.plugin.go +++ b/go-jwt-kc.plugin.go @@ -11,7 +11,7 @@ import ( "strings" ) -const PluginVersion = "0.1" +const PluginVersion = "0.0.1" var PluginPriority = 1005 From 5cffc85709e9b932e73107e7094f26bdc0d94edd Mon Sep 17 00:00:00 2001 From: Christopher Braun Date: Thu, 7 Nov 2024 16:26:31 +0100 Subject: [PATCH 2/2] Feature/add test step (#2) * added test workflow. * fixed wrong syntax. --- .github/workflows/_test.yml | 20 ++++++++++++++++++++ .github/workflows/build.yml | 6 +++++- 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/_test.yml diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml new file mode 100644 index 0000000..4cdaa26 --- /dev/null +++ b/.github/workflows/_test.yml @@ -0,0 +1,20 @@ +name: Test + +on: + workflow_call: + +jobs: + test: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v5 + with: + go-version: '1.23' + + - name: Test + run: go test -v ./... diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94e8988..ab2620e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,10 +1,14 @@ -name: Build-and-Release +name: Build on: [ push ] jobs: + run-test: + uses: ./.github/workflows/_test.yml + build: runs-on: ubuntu-latest + needs: run-test strategy: matrix: