Skip to content

Commit

Permalink
feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Aden-Q committed Apr 26, 2024
1 parent dce4d9b commit f36f07e
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go

name: Go

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build-test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4

- name: set up Go
uses: actions/setup-go@v5
with:
go-version: '1.21'

- name: install dependencies
run: go get ./...

- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.54

- name: build
run: go build -race -v ./...

- name: test
run: |
go install github.com/onsi/ginkgo/v2/ginkgo
ginkgo run -r -cover
48 changes: 48 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Bump version

on:
pull_request:
types:
- closed
branches:
- main

jobs:
tag-release:
if: github.event.pull_request.merged == true
runs-on: ubuntu-22.04
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.merge_commit_sha }}
fetch-depth: '0'

- name: Bump version and push tag
id: tag
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WITH_V: true

- name: Generate release changelog
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
onlyLastTag: true

- name: Create github release
if: ${{ success() }}
run: |
gh release create \
${{ steps.tag.outputs.new_tag }} \
--title ${{ steps.tag.outputs.new_tag }} \
--notes-file CHANGELOG.md \
--target main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Skip github release
if: ${{ failure() }}
run: echo "Skipping github release"

0 comments on commit f36f07e

Please sign in to comment.