Skip to content

Commit

Permalink
feat(ci): adopted ci for go update
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Haar <christopher.haar@upbound.io>
  • Loading branch information
haarchri committed Apr 18, 2024
1 parent 216ae57 commit aeff610
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,18 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true

- name: Setup Go
uses: actions/setup-go@v2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(make go.cachedir)"
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand All @@ -64,7 +64,7 @@ jobs:
restore-keys: ${{ runner.os }}-build-lint-

- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand All @@ -87,28 +87,28 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true

- name: Setup Go
uses: actions/setup-go@v2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(make go.cachedir)"
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: ${{ steps.go.outputs.cache }}
key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ runner.os }}-build-check-diff-

- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand All @@ -127,21 +127,21 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(make go.cachedir)"
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand All @@ -151,7 +151,7 @@ jobs:
restore-keys: ${{ runner.os }}-build-unit-tests-

- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -187,21 +187,21 @@ jobs:
install: true

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(make go.cachedir)"
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand All @@ -211,7 +211,7 @@ jobs:
restore-keys: ${{ runner.os }}-build-e2e-tests-

- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand Down Expand Up @@ -248,21 +248,21 @@ jobs:
install: true

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
with:
submodules: true

- name: Fetch History
run: git fetch --prune --unshallow

- name: Setup Go
uses: actions/setup-go@v2
- name: Setup Go
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Find the Go Build Cache
id: go
run: echo "::set-output name=cache::$(make go.cachedir)"
run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT

- name: Cache the Go Build Cache
uses: actions/cache@v2
Expand All @@ -272,7 +272,7 @@ jobs:
restore-keys: ${{ runner.os }}-build-publish-artifacts-

- name: Cache Go Dependencies
uses: actions/cache@v2
uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4
with:
path: .work/pkg
key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }}
Expand All @@ -287,27 +287,27 @@ jobs:
# We're using docker buildx, which doesn't actually load the images it
# builds by default. Specifying --load does so.
BUILD_ARGS: "--load"

- name: Publish Artifacts to GitHub
uses: actions/upload-artifact@v2
with:
name: output
path: _output/**

- name: Login to Docker
uses: docker/login-action@v1
if: env.CONTRIB_DOCKER_USR != ''
with:
username: ${{ secrets.CONTRIB_DOCKER_USR }}
password: ${{ secrets.CONTRIB_DOCKER_PSW }}

- name: Login to Upbound
uses: docker/login-action@v1
if: env.XPKG_ACCESS_ID != ''
with:
registry: xpkg.upbound.io
username: ${{ secrets.XPKG_ACCESS_ID }}
password: ${{ secrets.XPKG_TOKEN }}

- name: Publish Artifacts
run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/}

0 comments on commit aeff610

Please sign in to comment.