Skip to content

Commit

Permalink
Add CI/CD pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
blechschmidt committed Jul 14, 2024
1 parent ec1ac19 commit 2f70c70
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Deploy Go Binaries

on:
push:
tags:
- 'v*.*.*'

permissions:
contents: write
id-token: write
attestations: write

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'

- name: Build
run: make dist

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bin-${{ github.ref_name }}
path: bin/*

- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
with:
subject-path: bin/*

- name: Upload Releases
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: bin/*
draft: true
prerelease: false
22 changes: 22 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Run Tests

on: push

jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
check-latest: true
go-version-file: 'go.mod'

- name: Run Tests
run: make test

0 comments on commit 2f70c70

Please sign in to comment.