-
Notifications
You must be signed in to change notification settings - Fork 36
55 lines (53 loc) · 1.42 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: Build Plugin
on:
push:
branches:
- master
tags:
- v*
pull_request:
jobs:
check-style:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: make check-style
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
- run: make test
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: '^1.21.0'
- run: make dist
- uses: actions/upload-artifact@v3
with:
name: mattermost-plugin-ai.tar.gz
path: dist/*.tar.gz
release:
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
needs:
- build
- test
- check-style
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: mattermost-plugin-ai.tar.gz
path: dist
- run: |
printf "## Commits\n" > release-notes.md
git log --pretty='format:- %h %s' --abbrev-commit --no-decorate --no-color $(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^)..HEAD >> release-notes.md
- run: gh release create "$GITHUB_REF_NAME" --title "$GITHUB_REF_NAME" --notes-file release-notes.md dist/*.tar.gz
env:
GH_TOKEN: ${{github.token}}