Skip to content

Commit

Permalink
add release workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Prawirdani committed Jul 30, 2024
1 parent f614212 commit 1b6236e
Showing 2 changed files with 46 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
name: CI

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
workflow_dispatch:

jobs:
test:
44 changes: 44 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Create Release

on:
push:
tags:
- 'v*'
jobs:
release:
runs-on: ubuntu-latest

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

- name: Retrieve Go version from go.mod
id: get-go-version
run: |
go_version=$(go mod edit -json | jq -r .Go)
echo "GO_VERSION=${go_version}" >> $GITHUB_ENV
echo "Go version is $go_version"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}

- name: Verify Dependencies
run: go mod verify

- name: Run Test
script: |
go get -d -v ./...
go test -race -v ./...
- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

0 comments on commit 1b6236e

Please sign in to comment.