Skip to content

Commit

Permalink
update go to address CVE (#290)
Browse files Browse the repository at this point in the history
  • Loading branch information
weinong authored Jun 6, 2023
1 parent 3a26c19 commit 4e991f5
Show file tree
Hide file tree
Showing 2 changed files with 186 additions and 186 deletions.
94 changes: 47 additions & 47 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Build on Push
on:
on:
push:
paths-ignore:
- docs/**
Expand All @@ -18,60 +18,60 @@ jobs:
env:
GO111MODULE: on
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19.10
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
- name: Check out code into the Go module directory
uses: actions/checkout@v3

- name: Build
run: make
- name: Build
run: make

- name: Test
run: make test
- name: Test
run: make test

- name: Build (linux)
env:
GOOS: linux
GOARCH: amd64
run: make
- name: Build (linux)
env:
GOOS: linux
GOARCH: amd64
run: make

- name: Build (linux/arm)
env:
GOOS: linux
GOARCH: arm64
run: make
- name: Build (linux/arm)
env:
GOOS: linux
GOARCH: arm64
run: make

- name: Build (darwin)
env:
GOOS: darwin
GOARCH: amd64
run: make
- name: Build (darwin)
env:
GOOS: darwin
GOARCH: amd64
run: make

- name: Build (darwin/arm)
env:
GOOS: darwin
GOARCH: arm64
run: make
- name: Build (darwin/arm)
env:
GOOS: darwin
GOARCH: arm64
run: make

- name: Build (windows)
env:
GOOS: windows
GOARCH: amd64
run: make
- name: Build (windows)
env:
GOOS: windows
GOARCH: amd64
run: make

- name: Build (windows/arm)
env:
GOOS: windows
GOARCH: arm64
run: make
- name: Build (windows/arm)
env:
GOOS: windows
GOARCH: arm64
run: make

- name: Snap Build
uses: snapcore/action-build@v1
id: snapbuild
- name: Snap Build
uses: snapcore/action-build@v1
id: snapbuild

- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
278 changes: 139 additions & 139 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,143 +9,143 @@ jobs:
env:
GO111MODULE: on
steps:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

# Read changelog and read versions etc.
- name: Check version is mentioned in Changelog.md
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
path: 'CHANGELOG.md'
# Check if the newest tag already exists
- name: Check if tag exist
uses: mukunku/tag-exists-action@5dfe2bf779fe5259360bb10b2041676713dcc8a3 # v1.1.0
id: check-tag-exists
with:
tag: "v${{ steps.changelog_reader.outputs.version }} release" # following the pattern of vx.x.xx release used in this repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create Release with artifacts
- name: Create Kubelogin Release
id: create_release
if: ${{ steps.check-tag-exists.outputs.exists == 'false'}}
uses: softprops/action-gh-release@v1
env:
- name: Set up Go 1.19
uses: actions/setup-go@v3
with:
go-version: 1.19.10
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3

# Read changelog and read versions etc.
- name: Check version is mentioned in Changelog.md
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
validation_depth: 10
path: "CHANGELOG.md"
# Check if the newest tag already exists
- name: Check if tag exist
uses: mukunku/tag-exists-action@5dfe2bf779fe5259360bb10b2041676713dcc8a3 # v1.1.0
id: check-tag-exists
with:
tag: "v${{ steps.changelog_reader.outputs.version }} release" # following the pattern of vx.x.xx release used in this repo
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name : "v${{ steps.changelog_reader.outputs.version }}"
name: "v${{ steps.changelog_reader.outputs.version }} release" # following the pattern of vx.x.xx release used in this repo
body: ${{ steps.changelog_reader.outputs.changes }}

# We need the latest tag in the git local workspace before it start building.
- name: Get tags
run: git fetch --tags

- name: Build (linux)
env:
GOOS: linux
GOARCH: amd64
run: make

- name: Build (linux/arm)
env:
GOOS: linux
GOARCH: arm64
run: make

- name: Build (darwin)
env:
GOOS: darwin
GOARCH: amd64
run: make

- name: Build (darwin/arm)
env:
GOOS: darwin
GOARCH: arm64
run: make

- name: Build (windows)
env:
GOOS: windows
GOARCH: amd64
run: make

- name: Build (windows/arm)
env:
GOOS: windows
GOARCH: arm64
run: make

- name: Snap Build
uses: snapcore/action-build@v1
id: snapbuild

- name: Zip
uses: montudor/action-zip@v1
with:
args: zip -qq -r kubelogin.zip bin

- name: Zip (win-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-win-amd64.zip bin/windows_amd64/kubelogin.exe

- name: Zip (win-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-win-arm64.zip bin/windows_arm64/kubelogin.exe

- name: Zip (darwin-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-darwin-amd64.zip bin/darwin_amd64/kubelogin

- name: Zip (darwin-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-darwin-arm64.zip bin/darwin_arm64/kubelogin

- name: Zip (linux-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-linux-amd64.zip bin/linux_amd64/kubelogin

- name: Zip (linux-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-linux-arm64.zip bin/linux_arm64/kubelogin

- name: Create sha256 Checksums
run: |
sha256sum kubelogin.zip > kubelogin.zip.sha256
sha256sum kubelogin-win-amd64.zip > kubelogin-win-amd64.zip.sha256
sha256sum kubelogin-win-arm64.zip > kubelogin-win-arm64.zip.sha256
sha256sum kubelogin-darwin-amd64.zip > kubelogin-darwin-amd64.zip.sha256
sha256sum kubelogin-darwin-arm64.zip > kubelogin-darwin-arm64.zip.sha256
sha256sum kubelogin-linux-amd64.zip > kubelogin-linux-amd64.zip.sha256
sha256sum kubelogin-linux-arm64.zip > kubelogin-linux-arm64.zip.sha256
- name: Publish
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: kubelogin.zip kubelogin-win-amd64.zip kubelogin-win-arm64.zip kubelogin-darwin-amd64.zip kubelogin-darwin-arm64.zip kubelogin-linux-amd64.zip kubelogin-linux-arm64.zip kubelogin.zip.sha256 kubelogin-win-amd64.zip.sha256 kubelogin-win-arm64.zip.sha256 kubelogin-darwin-amd64.zip.sha256 kubelogin-darwin-arm64.zip.sha256 kubelogin-linux-amd64.zip.sha256 kubelogin-linux-arm64.zip.sha256
releaseId: ${{ steps.create_release.outputs.id }}

- name: Publish to Snap Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPSTORE_LOGIN }}
with:
snap: ${{ steps.snapbuild.outputs.snap }}
release: stable
# Create Release with artifacts
- name: Create Kubelogin Release
id: create_release
if: ${{ steps.check-tag-exists.outputs.exists == 'false'}}
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: "v${{ steps.changelog_reader.outputs.version }}"
name: "v${{ steps.changelog_reader.outputs.version }} release" # following the pattern of vx.x.xx release used in this repo
body: ${{ steps.changelog_reader.outputs.changes }}

# We need the latest tag in the git local workspace before it start building.
- name: Get tags
run: git fetch --tags

- name: Build (linux)
env:
GOOS: linux
GOARCH: amd64
run: make

- name: Build (linux/arm)
env:
GOOS: linux
GOARCH: arm64
run: make

- name: Build (darwin)
env:
GOOS: darwin
GOARCH: amd64
run: make

- name: Build (darwin/arm)
env:
GOOS: darwin
GOARCH: arm64
run: make

- name: Build (windows)
env:
GOOS: windows
GOARCH: amd64
run: make

- name: Build (windows/arm)
env:
GOOS: windows
GOARCH: arm64
run: make

- name: Snap Build
uses: snapcore/action-build@v1
id: snapbuild

- name: Zip
uses: montudor/action-zip@v1
with:
args: zip -qq -r kubelogin.zip bin

- name: Zip (win-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-win-amd64.zip bin/windows_amd64/kubelogin.exe

- name: Zip (win-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-win-arm64.zip bin/windows_arm64/kubelogin.exe

- name: Zip (darwin-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-darwin-amd64.zip bin/darwin_amd64/kubelogin

- name: Zip (darwin-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-darwin-arm64.zip bin/darwin_arm64/kubelogin

- name: Zip (linux-amd64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-linux-amd64.zip bin/linux_amd64/kubelogin

- name: Zip (linux-arm64)
uses: montudor/action-zip@v1
with:
args: zip -qq kubelogin-linux-arm64.zip bin/linux_arm64/kubelogin

- name: Create sha256 Checksums
run: |
sha256sum kubelogin.zip > kubelogin.zip.sha256
sha256sum kubelogin-win-amd64.zip > kubelogin-win-amd64.zip.sha256
sha256sum kubelogin-win-arm64.zip > kubelogin-win-arm64.zip.sha256
sha256sum kubelogin-darwin-amd64.zip > kubelogin-darwin-amd64.zip.sha256
sha256sum kubelogin-darwin-arm64.zip > kubelogin-darwin-arm64.zip.sha256
sha256sum kubelogin-linux-amd64.zip > kubelogin-linux-amd64.zip.sha256
sha256sum kubelogin-linux-arm64.zip > kubelogin-linux-arm64.zip.sha256
- name: Publish
uses: skx/github-action-publish-binaries@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
args: kubelogin.zip kubelogin-win-amd64.zip kubelogin-win-arm64.zip kubelogin-darwin-amd64.zip kubelogin-darwin-arm64.zip kubelogin-linux-amd64.zip kubelogin-linux-arm64.zip kubelogin.zip.sha256 kubelogin-win-amd64.zip.sha256 kubelogin-win-arm64.zip.sha256 kubelogin-darwin-amd64.zip.sha256 kubelogin-darwin-arm64.zip.sha256 kubelogin-linux-amd64.zip.sha256 kubelogin-linux-arm64.zip.sha256
releaseId: ${{ steps.create_release.outputs.id }}

- name: Publish to Snap Store
uses: snapcore/action-publish@v1
env:
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPSTORE_LOGIN }}
with:
snap: ${{ steps.snapbuild.outputs.snap }}
release: stable

0 comments on commit 4e991f5

Please sign in to comment.