Skip to content

Commit

Permalink
ci: update ci action & dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
heronimus committed Mar 22, 2024
1 parent dda2f2b commit ea284c2
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 14 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ on:
default: false
required: false
type: boolean
env:
GO_VERSION: 1.21.0

jobs:
build-go:
name: Go
runs-on: ubuntu-latest
strategy:
matrix:
go-version: [1.21.x]
runs-on: namespace-profile-linux-4vcpu-8gb-cached
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
cache-dependency-path: "go.sum"
go-version: ${{ env.GO_VERSION }}
## skip cache, use Namespace volume cache
cache: false
- name: Build
run: make build
21 changes: 16 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
release:
types: [created]

env:
GORELEASER_VERSION: v1.24.0
GO_VERSION: 1.21.0

permissions:
contents: write

Expand All @@ -13,21 +17,28 @@ jobs:
uses: ./.github/workflows/test.yml

goreleaser:
runs-on: ubuntu-latest
runs-on: namespace-profile-linux-4vcpu-8gb-cached
needs: go-test
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
- name: Setup Golang
uses: actions/setup-go@v5
with:
go-version: stable
- name: Run GoReleaser
go-version: ${{ env.GO_VERSION }}
## skip cache, use Namespace volume cache
cache: false
- name: Setup Namespace cache
uses: namespacelabs/nscloud-cache-action@v1
with:
cache: go
- name: Run World CLI GoReleaser
uses: goreleaser/goreleaser-action@v5
with:
distribution: goreleaser
version: latest
version: ${{ env.GORELEASER_VERSION }}
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
# Setup Docker build to use Namespace workspace builder
- name: Configure Namespace powered Buildx
uses: namespacelabs/nscloud-setup-buildx-action@v0
- name: Setup Golang
uses: actions/setup-go@v5
with:
Expand All @@ -39,6 +36,7 @@ jobs:
shell: 'script -q -e -c "bash {0}"'
run: make test-coverage
- name: Upload coverage to Codecov
if: github.ref == 'refs/heads/main' || github.event_name == 'pull_request'
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down

0 comments on commit ea284c2

Please sign in to comment.