Skip to content

Commit

Permalink
add github actions to make the releases
Browse files Browse the repository at this point in the history
  • Loading branch information
b-dean committed Feb 22, 2024
1 parent ea9558a commit cb5e3ce
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 4 deletions.
14 changes: 14 additions & 0 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: test
description: tests isclib
inputs:
go-version:
description: "the version of golang"
default: '1.21'
runs:
using: composite
steps:
- uses: actions/setup-go@v3
with:
go-version: ${{ inputs.go-version }}
- run: make prep test
shell: bash
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: release
on:
push:
tags: ['v*.*.*']

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: master
- run: git fetch --tags
- name: check branch
run: |
br="$(git branch --contains $GITHUB_REF --format '%(refname:short)' master)"
if [[ "$br" != "master" ]]; then
echo "$br != master"
exit 1
fi
- name: Test
uses: ./.github/actions/test
- name: release-notes
run: 'echo "$(git tag -l --format="%(contents:body)" $GITHUB_REF_NAME)" > RELEASE_NOTES'
- name: version
id: version
run: 'git describe --always --dirty $GITHUB_REF_NAME | sed "s/^v//"'
- uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref }}
body_path: RELEASE_NOTES
env:
GITHUB_TOKEN: ${{ github.token }}
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.20'
go-version: '1.21'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
Expand All @@ -20,8 +20,8 @@ jobs:
version: ['1.20', '1.21']
name: Go ${{ matrix.version }}
steps:
- uses: actions/setup-go@v3
- uses: actions/checkout@v2
- name: Test
uses: ./.github/actions/test
with:
go-version: ${{ matrix.version }}
- uses: actions/checkout@v3
- run: make prep test

0 comments on commit cb5e3ce

Please sign in to comment.