Skip to content

Commit

Permalink
ci: Optimize GoReleaser integration and simplify CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
yarlson committed Sep 15, 2024
1 parent 0de01de commit c22af5d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 35 deletions.
36 changes: 3 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
name: CI/CD Pipeline
name: CI Pipeline

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
release:
types: [created]

jobs:
build-test-lint:
build-lint:
name: Build, Test, and Lint
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
go-version: ['1.22.x', 'stable']
go-version: ["1.22.x", "stable"]
os: [ubuntu-latest]
steps:
- name: Checkout code
Expand Down Expand Up @@ -44,33 +41,6 @@ jobs:
- name: Run build
run: go build

release:
name: Build and Release
runs-on: ubuntu-latest
needs: build-test-lint
if: github.event_name == 'release' && github.event.action == 'created'
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: stable
cache: true

- name: Set up Goreleaser
uses: goreleaser/goreleaser-action@v4
with:
version: latest

- name: Run Goreleaser
uses: goreleaser/goreleaser-action@v4
with:
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

security:
name: CodeQL Analysis
runs-on: ubuntu-latest
Expand Down
30 changes: 30 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release Pipeline

on:
release:
types: [created]

permissions:
contents: write

jobs:
goreleaser:
name: Build and Release with GoReleaser
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Go
uses: actions/setup-go@v5

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: "~> v2"
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4 changes: 2 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
version: 2

project_name: aerie

builds:
Expand All @@ -19,13 +21,11 @@ archives:
files:
- LICENSE
- README.md
- CHANGELOG.md

release:
github:
owner: enclave-ci
name: aerie


checksum:
name_template: "{{ .ProjectName }}_{{ .Version }}_checksums.txt"

0 comments on commit c22af5d

Please sign in to comment.