Skip to content

Commit

Permalink
Added CI
Browse files Browse the repository at this point in the history
  • Loading branch information
derektata committed Aug 23, 2024
1 parent 2f45fa5 commit f357b37
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

name: CI

on:
pull_request:
types: [synchronize, reopened, closed]
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
${{ github.workspace }}/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
50 changes: 50 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Release

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

jobs:
build-and-release:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.20"

- name: Install UPX
run: sudo apt-get install -y upx

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
${{ github.workspace }}/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Build and compress binaries
run: make build

- name: Generate Release Info
run: echo ${{ github.sha }} > build/Release.txt

- name: Test Release Info
run: cat build/Release.txt

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/*
LICENSE
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

0 comments on commit f357b37

Please sign in to comment.