-
Notifications
You must be signed in to change notification settings - Fork 1
74 lines (74 loc) · 2.16 KB
/
blogctl.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: test
on: [push]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- uses: ruby/setup-ruby@v1
with:
ruby-version: '3.0'
- name: install task
run: curl -Ls https://git.io/ttask.sh | sh
- name: install bundler
run: |
gem install bundler
bundle update --bundler
bundler install
- name: run tests
run: ./bin/task ci
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: install task
run: curl -Ls https://git.io/ttask.sh | sh
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
- name: run linter
run: ./bin/task lint
build:
name: Build blogctl
if: startsWith(github.ref, 'refs/tags/v')
needs: [test, lint]
runs-on: ubuntu-latest
strategy:
matrix:
goos: [linux, darwin]
goarch: [amd64]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- name: install task
run: curl -Ls https://git.io/ttask.sh | sh
- run: ./bin/task bin
- run: mv ci-build/blogctl ci-build/blogctl_${{ matrix.goos }}_${{ matrix.goarch }}
- uses: actions/upload-artifact@master
with:
name: build-artifacts
path: ci-build
release:
name: Release blogctl
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- name: install changelogger
run: curl -Ls https://git.io/changelogger.sh | sh
- uses: actions/download-artifact@master
with:
name: build-artifacts
path: ci-build
- name: Save changelog entries of current release
run: ./bin/changelogger release last > CHANGELOG_RELEASE.md
- name: Print changelog entries for debugging
run: cat CHANGELOG_RELEASE.md
- name: Release
uses: softprops/action-gh-release@v1
with:
files: ci-build/*
body_path: CHANGELOG_RELEASE.md
token: ${{ secrets.GITHUB_TOKEN }}